"""meeting type controls

Revision ID: cc5a2d509450
Revises: 94dd1ac233dd
Create Date: 2021-02-14 07:53:24.988577

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'cc5a2d509450'
down_revision = '94dd1ac233dd'
branch_labels = None
depends_on = None


def upgrade(engine_name):
    globals()["upgrade_%s" % engine_name]()


def downgrade(engine_name):
    globals()["downgrade_%s" % engine_name]()





def upgrade_():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('meetingtype',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('interest_id', sa.Integer(), nullable=True),
    sa.Column('order', sa.Integer(), nullable=True),
    sa.Column('meetingtype', sa.Text(), nullable=True),
    sa.Column('options', sa.Text(), nullable=True),
    sa.Column('meetingwording', sa.Text(), nullable=True),
    sa.Column('statusreportwording', sa.Text(), nullable=True),
    sa.Column('invitewording', sa.Text(), nullable=True),
    sa.Column('version_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['interest_id'], ['localinterest.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('meetingstatusreport_tag',
    sa.Column('meeting_id', sa.Integer(), nullable=True),
    sa.Column('tag_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['meeting_id'], ['meeting.id'], ),
    sa.ForeignKeyConstraint(['tag_id'], ['tag.id'], )
    )
    op.add_column('meeting', sa.Column('meetingtype_id', sa.Integer(), nullable=True))
    op.create_foreign_key('meeting_ibfk_3', 'meeting', 'meetingtype', ['meetingtype_id'], ['id'])
    op.add_column('motionvote', sa.Column('motionvotekey', sa.Text(), nullable=True))
    # ### end Alembic commands ###


def downgrade_():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('motionvote', 'motionvotekey')
    op.drop_constraint('meeting_ibfk_3', 'meeting', type_='foreignkey')
    op.drop_column('meeting', 'meetingtype_id')
    op.drop_table('meetingstatusreport_tag')
    op.drop_table('meetingtype')
    # ### end Alembic commands ###


def upgrade_users():
    # ### commands auto generated by Alembic - please adjust! ###
    pass
    # ### end Alembic commands ###


def downgrade_users():
    # ### commands auto generated by Alembic - please adjust! ###
    pass
    # ### end Alembic commands ###

