aboutsummaryrefslogtreecommitdiff
path: root/migrations
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2022-11-10 16:30:44 +0300
committerFrederick Muriuki Muriithi2022-11-10 16:30:44 +0300
commit3bc52c3c6fb86f599f1f086fb62009a0af562f41 (patch)
treecd069192be05fd0e6bf7e3d85f774a9094fe092f /migrations
parent5ee7eee279cc4508b3bbdc737e75969b4a2dfb20 (diff)
downloadgenenetwork3-3bc52c3c6fb86f599f1f086fb62009a0af562f41.tar.gz
Migrations: Add columns to 'privileges' table
* migrations/auth/20221110_08_23psB-add-privilege-category-and-privilege-description-columns-to-privileges-table.py: new migration * tests/unit/auth/test_migrations_add_remove_columns.py: test new migration
Diffstat (limited to 'migrations')
-rw-r--r--migrations/auth/20221110_08_23psB-add-privilege-category-and-privilege-description-columns-to-privileges-table.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/migrations/auth/20221110_08_23psB-add-privilege-category-and-privilege-description-columns-to-privileges-table.py b/migrations/auth/20221110_08_23psB-add-privilege-category-and-privilege-description-columns-to-privileges-table.py
new file mode 100644
index 0000000..077182b
--- /dev/null
+++ b/migrations/auth/20221110_08_23psB-add-privilege-category-and-privilege-description-columns-to-privileges-table.py
@@ -0,0 +1,22 @@
+"""
+Add 'privilege_category' and 'privilege_description' columns to 'privileges' table
+"""
+
+from yoyo import step
+
+__depends__ = {'20221110_07_7WGa1-create-role-privileges-table'}
+
+steps = [
+ step(
+ """
+ ALTER TABLE privileges ADD COLUMN
+ privilege_category TEXT NOT NULL DEFAULT 'common'
+ """,
+ "ALTER TABLE privileges DROP COLUMN privilege_category"),
+ step(
+ """
+ ALTER TABLE privileges ADD COLUMN
+ privilege_description TEXT
+ """,
+ "ALTER TABLE privileges DROP COLUMN privilege_description")
+]