"""init tables

Revision ID: d9010a1ce682
Revises: 
Create Date: 2021-01-17 04:44:11.493744

"""
from alembic import op
import sqlalchemy as sa


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


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('post_mortems',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('title', sa.String(), nullable=True),
    sa.Column('start_timestamp', sa.DateTime(), nullable=True),
    sa.Column('end_timestamp', sa.DateTime(), nullable=True),
    sa.Column('description', sa.String(), nullable=True),
    sa.Column('steps', sa.JSON(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('users',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('full_name', sa.String(), nullable=True),
    sa.Column('nickname', sa.String(), nullable=True),
    sa.Column('hash', sa.String(), nullable=True),
    sa.Column('post_mortem_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['post_mortem_id'], ['post_mortems.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ###


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