aboutsummaryrefslogtreecommitdiff
path: root/migrations/auth
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2022-12-08 05:52:57 +0300
committerFrederick Muriuki Muriithi2022-12-08 08:35:42 +0300
commitb939c1fc96398708accc84c3026ce9f48654d7a8 (patch)
treed73960bf00661c3fbee0ebfe1cce71b6afc2b0d7 /migrations/auth
parentc75ed75c6a5987eed6672be924870f86282ed6d6 (diff)
downloadgenenetwork3-b939c1fc96398708accc84c3026ce9f48654d7a8.tar.gz
migrations: Add column `public` to `resources` table
* migrations/auth/20221208_01_sSdHz-add-public-column-to-resources-table.py: new migration script. * tests/unit/auth/test_migrations_add_remove_columns.py: test new migration script
Diffstat (limited to 'migrations/auth')
-rw-r--r--migrations/auth/20221208_01_sSdHz-add-public-column-to-resources-table.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/migrations/auth/20221208_01_sSdHz-add-public-column-to-resources-table.py b/migrations/auth/20221208_01_sSdHz-add-public-column-to-resources-table.py
new file mode 100644
index 0000000..2238069
--- /dev/null
+++ b/migrations/auth/20221208_01_sSdHz-add-public-column-to-resources-table.py
@@ -0,0 +1,16 @@
+"""
+Add 'public' column to 'resources' table
+"""
+
+from yoyo import step
+
+__depends__ = {'20221206_01_BbeF9-create-group-user-roles-on-resources-table'}
+
+steps = [
+ step(
+ """
+ ALTER TABLE resources ADD COLUMN
+ public INTEGER NOT NULL DEFAULT 0 CHECK (public=0 or public=1)
+ """,
+ "ALTER TABLE resources DROP COLUMN public")
+]