Skip to content

Commit

Permalink
revoking and destroying roles created by the upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
P0NDER0SA committed May 29, 2024
1 parent 43d07f0 commit 9ccd2e7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions migrations/versions/0451_create_db_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ def upgrade():
op.execute(f"GRANT {super_role} TO {role} WITH ADMIN OPTION;")


def downgrade():
for role in roles:
op.execute(f"REVOKE {super_role} FROM {role};")
op.execute(f"DROP ROLE IF EXISTS {role};")


def create_role_if_not_exist(role):
"""
Makes sure the expected user exists in the database before performing the GRANT USER operation.
Expand Down

0 comments on commit 9ccd2e7

Please sign in to comment.