From c4aaca0c15bf8fde47708a7d8df551b478d67fb2 Mon Sep 17 00:00:00 2001 From: Oper18 Date: Wed, 8 Apr 2020 11:08:07 +0300 Subject: [PATCH 1/2] add uuid field --- orator/schema/grammars/postgres_grammar.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/orator/schema/grammars/postgres_grammar.py b/orator/schema/grammars/postgres_grammar.py index e1086f8b..7c7e5fbf 100644 --- a/orator/schema/grammars/postgres_grammar.py +++ b/orator/schema/grammars/postgres_grammar.py @@ -215,6 +215,9 @@ def _type_timestamp(self, column): def _type_binary(self, column): return "BYTEA" + def _type_uuid(self, column): + return "UUID" + def _modify_nullable(self, blueprint, column): if column.get("nullable"): return " NULL" From 7fbd0ae89ac79a185116070d70e2ab25e31a5670 Mon Sep 17 00:00:00 2001 From: Oper18 Date: Thu, 9 Apr 2020 08:18:50 +0300 Subject: [PATCH 2/2] add uuid method --- orator/schema/blueprint.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/orator/schema/blueprint.py b/orator/schema/blueprint.py index d32aadd6..dcad46eb 100644 --- a/orator/schema/blueprint.py +++ b/orator/schema/blueprint.py @@ -522,6 +522,9 @@ def boolean(self, column): """ return self._add_column("boolean", column) + def uuid(self, column): + return self._add_column('uuid', column) + def enum(self, column, allowed): """ Create a new enum column on the table.