"""empty message

Revision ID: 6fbc95a3b411
Revises: None
Create Date: 2017-04-29 14:49:33.092070

"""

# revision identifiers, used by Alembic.
revision = '6fbc95a3b411'
down_revision = None

from alembic import op
import sqlalchemy as sa


def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('Topic',
    sa.Column('TopicId', sa.Integer(), nullable=False),
    sa.Column('Name', sa.String(length=256), nullable=False),
    sa.Column('SoftDelete', sa.Integer(), nullable=False),
    sa.Column('CreateDate', sa.DateTime(timezone=True), nullable=False),
    sa.Column('CreateBy', sa.String(length=128), nullable=False),
    sa.Column('ModifiedDate', sa.DateTime(timezone=True), nullable=True),
    sa.Column('ModifiedBy', sa.String(length=128), nullable=True),
    sa.Column('Html', sa.TEXT(), nullable=True),
    sa.Column('MarkDown', sa.TEXT(), nullable=True),
    sa.PrimaryKeyConstraint('TopicId')
    )
    op.create_table('Table',
    sa.Column('TableId', sa.Integer(), nullable=False),
    sa.Column('TopicId', sa.Integer(), nullable=False),
    sa.Column('Title', sa.String(length=256), nullable=False),
    sa.Column('SubTitle', sa.String(length=256), nullable=False),
    sa.Column('Color', sa.String(length=256), nullable=False),
    sa.Column('SoftDelete', sa.Integer(), nullable=False),
    sa.Column('CreateDate', sa.DateTime(timezone=True), nullable=False),
    sa.Column('CreateBy', sa.String(length=128), nullable=False),
    sa.Column('ModifiedDate', sa.DateTime(timezone=True), nullable=True),
    sa.Column('ModifiedBy', sa.String(length=128), nullable=True),
    sa.ForeignKeyConstraint(['TopicId'], ['Topic.TopicId'], ),
    sa.PrimaryKeyConstraint('TableId')
    )
    op.create_table('TableColumn',
    sa.Column('TableColumnId', sa.Integer(), nullable=False),
    sa.Column('TableId', sa.Integer(), nullable=False),
    sa.Column('Name', sa.String(length=256), nullable=False),
    sa.Column('Comment', sa.String(length=256), nullable=True),
    sa.Column('SoftDelete', sa.Integer(), nullable=False),
    sa.Column('CreateDate', sa.DateTime(timezone=True), nullable=False),
    sa.Column('CreateBy', sa.String(length=128), nullable=False),
    sa.Column('ModifiedDate', sa.DateTime(timezone=True), nullable=True),
    sa.Column('ModifiedBy', sa.String(length=128), nullable=True),
    sa.Column('Html', sa.TEXT(), nullable=True),
    sa.Column('MarkDown', sa.TEXT(), nullable=True),
    sa.ForeignKeyConstraint(['TableId'], ['Table.TableId'], ),
    sa.PrimaryKeyConstraint('TableColumnId')
    )
    ### end Alembic commands ###


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