<filename>migrations/versions/0253_set_template_postage_.py<gh_stars>10-100
"""

Revision ID: 0253_set_template_postage
Revises: 0252_letter_branding_table
Create Date: 2019-01-30 16:47:08.599448

"""
import sqlalchemy as sa
from alembic import op

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 ###

<filename>migrations/versions/0253_set_template_postage_.py<gh_stars>10-100
"""

Revision ID: 0253_set_template_postage
Revises: 0252_letter_branding_table
Create Date: 2019-01-30 16:47:08.599448

"""
import sqlalchemy as sa
from alembic import op

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 ###

Revision ID: 0253_set_template_postage Revises: 0252_letter_branding_table Create Date: 2019-01-30 16:47:08.599448 # ### commands auto generated by Alembic - please adjust! ### UPDATE templates SET postage = services.postage         FROM services WHERE template_type = 'letter' AND service_id = services.id # ### end Alembic commands ### # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ###