"""Added the 'article' table.

Revision ID: 85abe5bcbac0
Revises: 6054f3f09626
Create Date: 2019-12-08 03:28:43.202699

"""
from alembic import op
import sqlalchemy as sa


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


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('article',
    sa.Column('article_id', sa.Integer(), nullable=False),
    sa.Column('article_title', sa.String(length=200), nullable=False),
    sa.Column('article_subtitle', sa.String(length=200), nullable=True),
    sa.Column('article_snippet', sa.String(length=5000), nullable=True),
    sa.Column('article_url', sa.String(length=500), nullable=True),
    sa.Column('pub_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(['pub_id'], ['publication.pub_id'], ondelete='CASCADE'),
    sa.PrimaryKeyConstraint('article_id')
    )
    # ### end Alembic commands ###


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