-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Made external permissioned users and slack users show diff (#3147)
* Made external permissioned users and slack users show diff * finished * Fix typing * k * Fix * k --------- Co-authored-by: Weves <chrisweaver101@gmail.com>
- Loading branch information
1 parent
521425a
commit 954b5b2
Showing
13 changed files
with
288 additions
and
132 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 = 'EXT_PERM_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
Oops, something went wrong.