aboutsummaryrefslogtreecommitdiff
path: root/migrations/postgresql
diff options
context:
space:
mode:
authorDaniel García <[email protected]>2020-03-14 13:22:30 +0100
committerDaniel García <[email protected]>2020-03-14 13:32:28 +0100
commit3fa78e7bb141979d6f6fdfa20aecc70493b80842 (patch)
treed7a3ecedbefb8b3c405bf9ef2f628c9a61c4969e /migrations/postgresql
parent70f3ab8ec3d6ccfd8ec8c71c888459de484d9b43 (diff)
downloadvaultwarden-3fa78e7bb141979d6f6fdfa20aecc70493b80842.tar.gz
vaultwarden-3fa78e7bb141979d6f6fdfa20aecc70493b80842.zip
Initial version of policies
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)
+);