fossasia/open-event-orga-server

View on GitHub
migrations/versions/rev-2019-08-24-20:32:00-ebfe89366d48_.py

Summary

Maintainability
A
35 mins
Test Coverage
"""empty message

Revision ID: ebfe89366d48
Revises: 90d62fe3b5e3
Create Date: 2019-08-24 20:32:00.535676

"""

from alembic import op
import sqlalchemy as sa

# revision identifiers, used by Alembic.
revision = 'ebfe89366d48'
down_revision = '90d62fe3b5e3'


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('custom_form_options',
                    sa.Column('deleted_at', sa.DateTime(timezone=True), nullable=True),
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('value', sa.String(), nullable=False),
                    sa.Column('custom_form_id', sa.Integer(), nullable=True),
                    sa.ForeignKeyConstraint(['custom_form_id'], ['custom_forms.id'], ondelete='CASCADE'),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.add_column('custom_forms', sa.Column('description', sa.String(), nullable=True))
    op.add_column('custom_forms', sa.Column('is_complex', sa.Boolean(), nullable=False, server_default='False'))

    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('custom_forms', 'is_complex')
    op.drop_column('custom_forms', 'description')
    op.drop_table('custom_form_options')
    # ### end Alembic commands ###