"""empty message

Revision ID: 3528db092ec4
Revises: 
Create Date: 2017-10-22 17:53:34.149039

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '3528db092ec4'
down_revision = None
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('categories',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=80), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('creators',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('firstname', sa.String(length=80), nullable=True),
    sa.Column('lastname', sa.String(length=80), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('media',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('category', sa.String(length=80), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('users',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('username', sa.String(length=80), nullable=True),
    sa.Column('password', sa.String(length=25), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('items',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('media_id', sa.Integer(), nullable=True),
    sa.Column('category_id', sa.Integer(), nullable=True),
    sa.Column('EAN', sa.Integer(), nullable=True),
    sa.Column('ASIN', sa.Integer(), nullable=True),
    sa.Column('ASIN_LINK_AMAZON', sa.String(length=1024), nullable=True),
    sa.Column('name', sa.String(length=80), nullable=True),
    sa.Column('synopsys', sa.String(length=1024), nullable=True),
    sa.Column('creation_date', sa.DateTime(), nullable=True),
    sa.Column('modification_date', sa.DateTime(), nullable=True),
    sa.ForeignKeyConstraint(['category_id'], ['categories.id'], ),
    sa.ForeignKeyConstraint(['media_id'], ['media.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('item_creator',
    sa.Column('item_id', sa.Integer(), nullable=False),
    sa.Column('creator_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['creator_id'], ['creators.id'], ),
    sa.ForeignKeyConstraint(['item_id'], ['items.id'], ),
    sa.PrimaryKeyConstraint('item_id', 'creator_id')
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('item_creator')
    op.drop_table('items')
    op.drop_table('users')
    op.drop_table('media')
    op.drop_table('creators')
    op.drop_table('categories')
    # ### end Alembic commands ###
