"""empty message

Revision ID: 164eca7b3af6
Revises: 
Create Date: 2020-03-25 11:56:03.977627

"""
from alembic import op
import sqlalchemy as sa


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


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('users',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('lang', sa.String(length=5), nullable=False),
    sa.Column('first_access', sa.DateTime(), nullable=False),
    sa.Column('last_access', sa.DateTime(), nullable=False),
    sa.Column('n_msgs', sa.Integer(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('appointments',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('dtime', sa.DateTime(), nullable=False),
    sa.Column('topic', sa.String(length=60), nullable=False),
    sa.Column('user_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['user_id'], ['users.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('intents',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=50), nullable=False),
    sa.Column('user_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['user_id'], ['users.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('parameters',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=50), nullable=False),
    sa.Column('text', sa.String(length=100), nullable=True),
    sa.Column('entry', sa.String(length=100), nullable=True),
    sa.Column('entity', sa.String(length=100), nullable=False),
    sa.Column('required', sa.Boolean(), nullable=False),
    sa.Column('intent_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['intent_id'], ['intents.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ###


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