"""Add table for example file contents

Revision ID: b0f952e4a027
Revises: 95f56a77a6e6
Create Date: 2022-05-22 07:28:12.639592

"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql

# revision identifiers, used by Alembic.
revision = 'b0f952e4a027'
down_revision = '95f56a77a6e6'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('example_file',
    sa.Column('id', sa.Integer(), nullable=False, autoincrement=True),
    sa.Column('submodule_id', sa.Integer(), nullable=False),
    sa.Column('path', sa.String(length=128), nullable=False),
    sa.Column('content', sa.LargeBinary(length=16777215).with_variant(mysql.MEDIUMBLOB(), 'mysql'), nullable=True),
    sa.ForeignKeyConstraint(['submodule_id'], ['submodule.id'], onupdate='CASCADE', ondelete='CASCADE'),
    sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('example_file')
    # ### end Alembic commands ###
