aboutsummaryrefslogtreecommitdiff
path: root/migrations/postgresql
diff options
context:
space:
mode:
Diffstat (limited to 'migrations/postgresql')
-rw-r--r--migrations/postgresql/2020-03-13-205045_add_policy_table/down.sql1
-rw-r--r--migrations/postgresql/2020-03-13-205045_add_policy_table/up.sql9
2 files changed, 10 insertions, 0 deletions
diff --git a/migrations/postgresql/2020-03-13-205045_add_policy_table/down.sql b/migrations/postgresql/2020-03-13-205045_add_policy_table/down.sql
new file mode 100644
index 00000000..8dc1826a
--- /dev/null
+++ b/migrations/postgresql/2020-03-13-205045_add_policy_table/down.sql
@@ -0,0 +1 @@
+DROP TABLE org_policies;
diff --git a/migrations/postgresql/2020-03-13-205045_add_policy_table/up.sql b/migrations/postgresql/2020-03-13-205045_add_policy_table/up.sql
new file mode 100644
index 00000000..a6b234ee
--- /dev/null
+++ b/migrations/postgresql/2020-03-13-205045_add_policy_table/up.sql
@@ -0,0 +1,9 @@
+CREATE TABLE org_policies (
+ uuid CHAR(36) NOT NULL PRIMARY KEY,
+ org_uuid CHAR(36) NOT NULL REFERENCES organizations (uuid),
+ atype INTEGER NOT NULL,
+ enabled BOOLEAN NOT NULL,
+ data TEXT NOT NULL,
+
+ UNIQUE (org_uuid, atype)
+);