aboutsummaryrefslogtreecommitdiff
path: root/migrations
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2023-09-08 05:06:17 +0300
committerFrederick Muriuki Muriithi2023-09-26 03:44:26 +0300
commit35bf3419be0ec5296457908d87266f178c7830f1 (patch)
tree9bf73b68cdca379d4113cd5c74fa1e1ebcc2b349 /migrations
parentff18444c08b0b4ae8478274d1fd793112971484e (diff)
downloadgn-auth-35bf3419be0ec5296457908d87266f178c7830f1.tar.gz
Add `system` and `group` resource categories.
Diffstat (limited to 'migrations')
-rw-r--r--migrations/auth/20230907_02_Enicg-refactor-add-system-and-group-resource-categories.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/migrations/auth/20230907_02_Enicg-refactor-add-system-and-group-resource-categories.py b/migrations/auth/20230907_02_Enicg-refactor-add-system-and-group-resource-categories.py
new file mode 100644
index 0000000..c4397c9
--- /dev/null
+++ b/migrations/auth/20230907_02_Enicg-refactor-add-system-and-group-resource-categories.py
@@ -0,0 +1,29 @@
+"""
+refactor: add 'system' and 'group' resource categories
+"""
+
+from yoyo import step
+
+__depends__ = {'20230907_01_pjnxz-refactor-add-resource-ownership-table'}
+
+steps = [
+ step(
+ """
+ INSERT INTO resource_categories VALUES
+ ('aa3d787f-af6a-44fa-9b0b-c82d40e54ad2',
+ 'system',
+ 'The overall system.',
+ '{"default-access-level": "public-read"}'),
+ ('1e0f70ee-add5-4358-8c6c-43de77fa4cce',
+ 'group',
+ 'A group resource.',
+ '{}')
+ """,
+ """
+ DELETE FROM resource_categories
+ WHERE resource_category_id IN (
+ 'aa3d787f-af6a-44fa-9b0b-c82d40e54ad2',
+ '1e0f70ee-add5-4358-8c6c-43de77fa4cce'
+ )
+ """)
+]