"""empty message.

Revision ID: b364a538f0db
Revises: 776b0d9121b7
Create Date: 2018-06-02 18:08:40.767099

"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql

from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, relationship

# revision identifiers, used by Alembic.
revision = 'b364a538f0db'
down_revision = '776b0d9121b7'

Base = declarative_base()
db = sa
db.Model = Base
db.relationship = relationship


def create_session():
    connection = op.get_bind()
    session_maker = sa.orm.sessionmaker()
    session = session_maker(bind=connection)
    db.session = session


def upgrade():
    create_session()

    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('setting',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('created', sa.DateTime(), nullable=True),
    sa.Column('modified', sa.DateTime(), nullable=True),
    sa.Column('key', sa.String(length=128), nullable=False),
    sa.Column('value', sa.String(length=128), nullable=True),
    sa.PrimaryKeyConstraint('id', name=op.f('pk_setting')),
    sa.UniqueConstraint('key', name=op.f('uq_setting_key')),
    schema='viaduct',
    sqlite_autoincrement=True
    )


def downgrade():
    create_session()

    op.drop_table('setting', schema='viaduct')
    # ### end Alembic commands ###


# vim: ft=python
