"""Added the 'publication' table.

Revision ID: 6054f3f09626
Revises: 39196521adc5
Create Date: 2019-12-02 14:42:56.073111

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '6054f3f09626'
down_revision = '39196521adc5'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('publication',
    sa.Column('pub_id', sa.Integer(), nullable=False),
    sa.Column('pub_name', sa.String(length=100), nullable=False),
    sa.Column('pub_edition', sa.String(length=100), nullable=True),
    sa.Column('pub_description', sa.String(length=1000), nullable=True),
    sa.Column('pub_url', sa.String(length=500), nullable=True),
    sa.Column('publ_id', sa.Integer(), nullable=True),
    sa.Column('time_created', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('time_updated', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.ForeignKeyConstraint(['publ_id'], ['publisher.publ_id'], ondelete='CASCADE'),
    sa.PrimaryKeyConstraint('pub_id')
    )
    # ### end Alembic commands ###


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