-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
4 changed files
with
37 additions
and
21 deletions.
There are no files selected for viewing
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,35 @@ | ||
"""remove views. | ||
Revision ID: 875f93f41d79 | ||
Revises: fe3054fbc892 | ||
Create Date: 2023-08-28 10:29:58.886117 | ||
""" | ||
|
||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "875f93f41d79" | ||
down_revision = "fe3054fbc892" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade() -> None: | ||
op.execute("DROP VIEW c3s_resources") | ||
op.execute("DROP VIEW cams_resources") | ||
|
||
|
||
def downgrade() -> None: | ||
sql1 = """ | ||
CREATE VIEW c3s_resources AS | ||
SELECT * FROM resources | ||
WHERE portal = 'c3s' | ||
""" | ||
op.execute(sql1) | ||
sql2 = """ | ||
CREATE VIEW cams_resources AS | ||
SELECT * FROM resources | ||
WHERE portal = 'cams' | ||
""" | ||
op.execute(sql2) |
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