-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5300 from bcgov/origin/dev-marshal-SS-3968
[FOIMOD-2479] Add OIPC email templates and migration
- Loading branch information
Showing
6 changed files
with
912 additions
and
2 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
68 changes: 68 additions & 0 deletions
68
...t-management-api/migrations/versions/8487688c2e35_add_applicantCorrespondenceTemplates.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,68 @@ | ||
"""empty message | ||
Revision ID: 8487688c2e35 | ||
Revises: c3e447d3d94d | ||
Create Date: 2024-06-20 17:16:09.447577 | ||
""" | ||
from alembic import op | ||
from datetime import datetime | ||
import sqlalchemy as sa | ||
from sqlalchemy.sql import column, table | ||
from sqlalchemy.sql.sqltypes import Boolean, String,Text,Integer,DateTime | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = '8487688c2e35' | ||
down_revision = 'c3e447d3d94d' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
applicant_correspondence_templates = table('ApplicantCorrespondenceTemplates', | ||
column('name',String), | ||
column('documenturipath',Text), | ||
column('description',String), | ||
column('active',Boolean), | ||
column('display',Boolean), | ||
column('version',Integer), | ||
column('created_at',DateTime), | ||
column('createdby',String), | ||
) | ||
op.bulk_insert( | ||
applicant_correspondence_templates, | ||
[{'name': 'OIPCAPPLICANTCONSENTEXTENSION', | ||
'description': 'OIPC Applicant Consent Time Extension', | ||
'active': True, | ||
'display': True, | ||
'version': 1, | ||
'documenturipath': '/TEMPLATES/EMAILS/oipc_applicant_consent_time_extension.html', | ||
'created_at': datetime.now(), | ||
'createdby': 'system'}, | ||
{'name': 'OIPCFIRSTTIMEEXTENSION', | ||
'description': 'OIPC Applicant First Time Extension', | ||
'active': True, | ||
'display': True, | ||
'version': 1, | ||
'documenturipath': '/TEMPLATES/EMAILS/oipc_first_time_extension.html', | ||
'created_at': datetime.now(), | ||
'createdby': 'system'}, | ||
{'name': 'OIPCSUBSEQUENTTIMEEXTENSION', | ||
'description': 'OIPC Subsequent Time Extension', | ||
'active': True, | ||
'display': True, | ||
'version': 1, | ||
'documenturipath': '/TEMPLATES/EMAILS/oipc_subsequent_time_extension.html', | ||
'created_at': datetime.now(), | ||
'createdby': 'system'}] | ||
) | ||
|
||
|
||
def downgrade(): | ||
op.execute( | ||
""" | ||
DELETE FROM "ApplicantCorrespondenceTemplates" | ||
WHERE name IN ('OIPCAPPLICANTCONSENTEXTENSION', 'OIPCFIRSTTIMEEXTENSION', 'OIPCSUBSEQUENTTIMEEXTENSION') | ||
""" | ||
) |
Oops, something went wrong.