aboutsummaryrefslogtreecommitdiff
path: root/migrations/auth/20230907_02_Enicg-refactor-add-system-and-group-resource-categories.py
blob: c4397c969594b1c14344b3ed9631d86b63baeea5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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'
        )
        """)
]