<filename>portal/migrations/versions/88f0e897cca0_.py
from alembic import op
import sqlalchemy as sa

"""empty message

Revision ID: 88f0e897cca0
Revises: e<PASSWORD>
Create Date: 2017-09-15 09:52:46.249435

"""

# revision identifiers, used by Alembic.
revision = '88f0e897cca0'
down_revision = 'e3923b19b6f5'


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column(
        'questionnaire_bank_recurs',
        sa.Column(
            'iteration_count',
            sa.Integer(),
            server_default='0',
            nullable=False))
    op.drop_constraint(
        u'_questionnaire_bank_recure',
        'questionnaire_bank_recurs',
        type_='unique')
    op.create_unique_constraint(
        '_questionnaire_bank_recure', 'questionnaire_bank_recurs', [
            'questionnaire_bank_id', 'recur_id', 'iteration_count'])
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(
        '_questionnaire_bank_recure',
        'questionnaire_bank_recurs',
        type_='unique')
    op.create_unique_constraint(
        u'_questionnaire_bank_recure', 'questionnaire_bank_recurs', [
            'questionnaire_bank_id', 'recur_id'])
    op.drop_column('questionnaire_bank_recurs', 'iteration_count')
    # ### end Alembic commands ###

<filename>portal/migrations/versions/88f0e897cca0_.py
from alembic import op
import sqlalchemy as sa

"""empty message

Revision ID: 88f0e897cca0
Revises: e<PASSWORD>
Create Date: 2017-09-15 09:52:46.249435

"""

# revision identifiers, used by Alembic.
revision = '88f0e897cca0'
down_revision = 'e3923b19b6f5'


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column(
        'questionnaire_bank_recurs',
        sa.Column(
            'iteration_count',
            sa.Integer(),
            server_default='0',
            nullable=False))
    op.drop_constraint(
        u'_questionnaire_bank_recure',
        'questionnaire_bank_recurs',
        type_='unique')
    op.create_unique_constraint(
        '_questionnaire_bank_recure', 'questionnaire_bank_recurs', [
            'questionnaire_bank_id', 'recur_id', 'iteration_count'])
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(
        '_questionnaire_bank_recure',
        'questionnaire_bank_recurs',
        type_='unique')
    op.create_unique_constraint(
        u'_questionnaire_bank_recure', 'questionnaire_bank_recurs', [
            'questionnaire_bank_id', 'recur_id'])
    op.drop_column('questionnaire_bank_recurs', 'iteration_count')
    # ### end Alembic commands ###

empty message  Revision ID: 88f0e897cca0 Revises: e<PASSWORD> Create Date: 2017-09-15 09:52:46.249435 # revision identifiers, used by Alembic. # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ### # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ###