"""empty message

Revision ID: 2e0561e7a614
Revises: 
Create Date: 2020-09-25 19:54:49.036241

"""
from alembic import op
import sqlalchemy as sa


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


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('device',
    sa.Column('key', sa.Integer(), nullable=False),
    sa.Column('id', sa.String(length=64), nullable=True),
    sa.Column('type', sa.String(length=64), nullable=False),
    sa.Column('unit_count', sa.Integer(), nullable=True),
    sa.Column('ip', sa.String(length=32), nullable=True),
    sa.PrimaryKeyConstraint('key')
    )
    op.create_table('raspberry',
    sa.Column('key', sa.Integer(), nullable=False),
    sa.Column('group', sa.String(length=64), nullable=False),
    sa.Column('id', sa.String(length=64), nullable=False),
    sa.Column('pw', sa.String(length=64), nullable=False),
    sa.Column('remote_control', sa.Boolean(), nullable=True),
    sa.Column('devices', sa.Text(), nullable=True),
    sa.PrimaryKeyConstraint('key')
    )
    op.create_table('using_time',
    sa.Column('key', sa.Integer(), nullable=False),
    sa.Column('date', sa.String(), nullable=True),
    sa.Column('time', sa.Integer(), nullable=True),
    sa.PrimaryKeyConstraint('key')
    )
    op.create_table('unit',
    sa.Column('key', sa.Integer(), nullable=False),
    sa.Column('index', sa.Integer(), nullable=False),
    sa.Column('device_key', sa.Integer(), nullable=True),
    sa.Column('on_off', sa.Boolean(), nullable=True),
    sa.Column('start', sa.DateTime(), nullable=True),
    sa.ForeignKeyConstraint(['device_key'], ['device.key'], ),
    sa.PrimaryKeyConstraint('key')
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('unit')
    op.drop_table('using_time')
    op.drop_table('raspberry')
    op.drop_table('device')
    # ### end Alembic commands ###
