forked from bcgov/met-public
-
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
92 changed files
with
1,373 additions
and
420 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,43 @@ | ||
""" Fill empty widget titles | ||
Revision ID: db737a0db061 | ||
Revises: df73727dc6d9b7_add_sub_tbl | ||
Create Date: 2023-08-04 14:11:01.993136 | ||
""" | ||
|
||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = 'db737a0db061' | ||
down_revision = 'df73727dc6d9b7_add_sub_tbl' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
|
||
# Execute an UPDATE statement to set 'title' based on 'widget_type_id' | ||
op.execute(""" | ||
UPDATE widget | ||
SET title = | ||
CASE | ||
WHEN widget_type_id = 1 THEN 'Who is Listening' | ||
WHEN widget_type_id = 2 THEN 'Documents' | ||
WHEN widget_type_id = 3 THEN 'Environmental Assessment Process' | ||
WHEN widget_type_id = 4 THEN 'Sign Up for Updates' | ||
WHEN widget_type_id = 5 THEN 'Events' | ||
WHEN widget_type_id = 6 THEN 'Map' | ||
WHEN widget_type_id = 7 THEN 'Video' | ||
ELSE 'Default Title' -- This is for any widget_type_id not covered above | ||
END | ||
WHERE title IS NULL; | ||
""") | ||
|
||
# ### end Alembic commands ### | ||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
|
||
# Execute an UPDATE statement to set 'title' to NULL for all rows | ||
op.execute("UPDATE widget SET title = NULL;") | ||
|
||
# ### end Alembic commands ### |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,4 @@ | |
|
||
|
||
SYSTEM_USER = 1 | ||
SYSTEM_REVIEWER = 'System' |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema", | ||
"$id": "https://met.gov.bc.ca/.well_known/schemas/widget_update", | ||
"type": "object", | ||
"title": "The root schema", | ||
"description": "The root schema comprises the entire JSON document.", | ||
"default": {}, | ||
"examples": [ | ||
{ | ||
"title": "Who is Listening" | ||
} | ||
], | ||
"required": ["title"], | ||
"properties": { | ||
"title": { | ||
"$id": "#/properties/title", | ||
"type": "string", | ||
"title": "Widget title", | ||
"description": "The title of the widget.", | ||
"examples": ["Who is Listening"] | ||
} | ||
} | ||
} |
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.