diff options
Diffstat (limited to 'db')
-rw-r--r-- | db/downgrade_0041---0040.sql | 9 | ||||
-rw-r--r-- | db/schema.sql | 6 | ||||
-rw-r--r-- | db/schema_0041-remove-permission-types-check.sql | 4 |
3 files changed, 14 insertions, 5 deletions
diff --git a/db/downgrade_0041---0040.sql b/db/downgrade_0041---0040.sql new file mode 100644 index 000000000..13bf083e8 --- /dev/null +++ b/db/downgrade_0041---0040.sql @@ -0,0 +1,9 @@ +begin; +ALTER TABLE user_body_permissions +ADD CONSTRAINT user_body_permissions_permission_type_check +CHECK ( + permission_type='moderate' or + -- for future expansion -- + permission_type='admin' +); +commit; diff --git a/db/schema.sql b/db/schema.sql index 3f73d2325..f285922ac 100644 --- a/db/schema.sql +++ b/db/schema.sql @@ -454,11 +454,7 @@ create table user_body_permissions ( id serial not null primary key, user_id int references users(id) not null, body_id int references body(id) not null, - permission_type text not null check( - permission_type='moderate' or - -- for future expansion -- - permission_type='admin' - ), + permission_type text not null, unique(user_id, body_id, permission_type) ); diff --git a/db/schema_0041-remove-permission-types-check.sql b/db/schema_0041-remove-permission-types-check.sql new file mode 100644 index 000000000..2e4c21050 --- /dev/null +++ b/db/schema_0041-remove-permission-types-check.sql @@ -0,0 +1,4 @@ +BEGIN; +ALTER TABLE user_body_permissions +DROP CONSTRAINT user_body_permissions_permission_type_check; +COMMIT; |