"""post types and posts table created

Revision ID: 98f6e12a7491
Revises: 7ae6503757f5
Create Date: 2020-11-05 17:09:36.322652

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '98f6e12a7491'
down_revision = '7ae6503757f5'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('post_types',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('type', sa.String(length=255), nullable=False),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('posts',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('user_id', sa.Integer(), nullable=False),
    sa.Column('description', sa.Text(), nullable=True),
    sa.Column('type_id', sa.Integer(), nullable=False),
    sa.Column('created_at', sa.String(length=100), nullable=False),
    sa.ForeignKeyConstraint(['type_id'], ['post_types.id'], ),
    sa.ForeignKeyConstraint(['user_id'], ['users.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ###


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