"""Added news comments model

Revision ID: af53c49ccce2
Revises: ad1d535d9a47
Create Date: 2018-03-28 17:19:20.047392

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'af53c49ccce2'
down_revision = 'ad1d535d9a47'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('CommentsNews',
    sa.Column('CommentID', sa.Integer(), nullable=False),
    sa.Column('NewsID', sa.Integer(), nullable=False),
    sa.Column('Comment', sa.Text(), nullable=False),
    sa.Column('UserID', sa.Integer(), nullable=False),
    sa.Column('Created', sa.DateTime(), nullable=True),
    sa.Column('Updated', sa.DateTime(), nullable=True),
    sa.ForeignKeyConstraint(['NewsID'], ['News.NewsID'], ondelete='CASCADE'),
    sa.ForeignKeyConstraint(['UserID'], ['Users.UserID'], ondelete='CASCADE'),
    sa.PrimaryKeyConstraint('CommentID')
    )
    # ### end Alembic commands ###


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