"""added Catalog model

Revision ID: 344ce4edecb1
Revises: 7f24fc243552
Create Date: 2016-06-14 15:49:55.957509

"""

# revision identifiers, used by Alembic.
revision = '344ce4edecb1'
down_revision = '7f24fc243552'

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

def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('catalog2',
    sa.Column('container_id', sa.Integer(), nullable=False),
    sa.Column('file_id', sa.Integer(), nullable=False),
    sa.Column('type', sa.String(length=50), nullable=True),
    sa.ForeignKeyConstraint(['container_id'], ['containers.id'], ),
    sa.ForeignKeyConstraint(['file_id'], ['files.id'], ),
    sa.PrimaryKeyConstraint('container_id', 'file_id')
    )
    op.drop_table('catalog')
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('catalog',
    sa.Column('container_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True),
    sa.Column('file_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True),
    sa.ForeignKeyConstraint(['container_id'], [u'containers.id'], name=u'catalog_ibfk_1'),
    sa.ForeignKeyConstraint(['file_id'], [u'files.id'], name=u'catalog_ibfk_2'),
    mysql_default_charset=u'utf8',
    mysql_engine=u'InnoDB'
    )
    op.drop_table('catalog2')
    ### end Alembic commands ###