fossasia/open-event-orga-server

View on GitHub
migrations/versions/rev-2023-06-27-12:53:43-abf585f1ad76_.py

Summary

Maintainability
C
7 hrs
Test Coverage
"""empty message

Revision ID: abf585f1ad76
Revises: 7a4ac439ef4d
Create Date: 2023-06-23 12:53:43.565148

"""

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'abf585f1ad76'
down_revision = '7a4ac439ef4d'


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('custom_form_translates',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(), nullable=False),
    sa.Column('custom_form_id', sa.Integer(), nullable=True),
    sa.Column('language_code', sa.String(), nullable=False),
    sa.Column('form_id', sa.String(), nullable=False),
    sa.ForeignKeyConstraint(['custom_form_id'], ['custom_forms.id'], ondelete='CASCADE'),
    sa.PrimaryKeyConstraint('id')
    )
    op.add_column('custom_forms', sa.Column('main_language', sa.String(), nullable=True))
    # ### end Alembic commands ###


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