aboutsummaryrefslogtreecommitdiff
path: root/migrations/auth/20240924_01_thbvh-hooks-for-edu-domains.py
blob: 5c6e81df41264d1e10c6e98caa70e56122291c96 (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
"""
hooks_for_edu_domains
"""

from yoyo import step

__depends__ = {'20240819_01_p2vXR-create-forgot-password-tokens-table'}

steps = [
    step(
        """
        INSERT INTO roles(role_id, role_name, user_editable) VALUES
            ('9bb203a2-7897-4fe3-ac4a-75e6a4f96f5d', 'hook-role-from-edu-domain', '0')
        """,
        "DELETE FROM roles WHERE role_name='hook-role-from-edu-domain'"),
    step(
        """
        INSERT INTO role_privileges(role_id, privilege_id) VALUES
            ('9bb203a2-7897-4fe3-ac4a-75e6a4f96f5d', 'group:resource:view-resource'),
            ('9bb203a2-7897-4fe3-ac4a-75e6a4f96f5d', 'group:resource:edit-resource')
        """,
        "DELETE FROM role_privileges WHERE role_id='9bb203a2-7897-4fe3-ac4a-75e6a4f96f5d'"
        )
]