mirror of
https://github.com/GSA/notifications-api.git
synced 2026-05-05 00:30:04 -04:00
Set postage for all existing templates to service default
This commit is contained in:
28
migrations/versions/0253_set_template_postage_.py
Normal file
28
migrations/versions/0253_set_template_postage_.py
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
"""
|
||||||
|
|
||||||
|
Revision ID: 0253_set_template_postage
|
||||||
|
Revises: 0252_letter_branding_table
|
||||||
|
Create Date: 2019-01-30 16:47:08.599448
|
||||||
|
|
||||||
|
"""
|
||||||
|
from alembic import op
|
||||||
|
import sqlalchemy as sa
|
||||||
|
|
||||||
|
|
||||||
|
revision = '0253_set_template_postage'
|
||||||
|
down_revision = '0252_letter_branding_table'
|
||||||
|
|
||||||
|
|
||||||
|
def upgrade():
|
||||||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
|
op.execute(
|
||||||
|
"""UPDATE templates SET postage = services.postage
|
||||||
|
FROM services WHERE template_type = 'letter' AND service_id = services.id"""
|
||||||
|
)
|
||||||
|
# ### end Alembic commands ###
|
||||||
|
|
||||||
|
|
||||||
|
def downgrade():
|
||||||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
|
op.execute("UPDATE templates SET postage = null WHERE template_type = 'letter'")
|
||||||
|
# ### end Alembic commands ###
|
||||||
Reference in New Issue
Block a user