-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0c86f2e
commit f7c5f0f
Showing
7 changed files
with
162 additions
and
43 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
backend/alembic/versions/dfbe9e93d3c7_extended_role_for_non_web.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
"""extended_role_for_non_web | ||
Revision ID: dfbe9e93d3c7 | ||
Revises: 9cf5c00f72fe | ||
Create Date: 2024-11-16 07:54:18.727906 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "dfbe9e93d3c7" | ||
down_revision = "9cf5c00f72fe" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade() -> None: | ||
op.execute( | ||
""" | ||
UPDATE "user" | ||
SET role = 'SLACK_USER' | ||
WHERE has_web_login = false | ||
""" | ||
) | ||
op.drop_column("user", "has_web_login") | ||
|
||
|
||
def downgrade() -> None: | ||
op.add_column( | ||
"user", | ||
sa.Column("has_web_login", sa.Boolean(), nullable=False, server_default="true"), | ||
) | ||
|
||
op.execute( | ||
""" | ||
UPDATE "user" | ||
SET has_web_login = false, | ||
role = 'BASIC' | ||
WHERE role IN ('SLACK_USER', 'EXT_PERM_USER') | ||
""" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters