"""empty message

Revision ID: 001
Revises: 
Create Date: 2019-04-04 12:32:11.992577

"""
from alembic import op
import sqlalchemy as sa


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


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('node',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=50), nullable=True),
    sa.Column('host_name', sa.String(length=100), nullable=True),
    sa.Column('order', sa.Integer(), nullable=True),
    sa.Column('timestamp', sa.DateTime(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('rc',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=50), nullable=True),
    sa.Column('public', sa.Boolean(), nullable=True),
    sa.Column('order', sa.Integer(), nullable=True),
    sa.Column('icon', sa.String(length=200), nullable=True),
    sa.Column('timestamp', sa.DateTime(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('user',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('username', sa.String(length=50), nullable=True),
    sa.Column('password', sa.String(length=255), nullable=True),
    sa.Column('role', sa.SmallInteger(), nullable=True),
    sa.Column('email', sa.String(length=190), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('email'),
    sa.UniqueConstraint('username')
    )
    op.create_table('arduino',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('node_id', sa.Integer(), nullable=True),
    sa.Column('usb', sa.String(length=20), nullable=True),
    sa.Column('name', sa.String(length=50), nullable=True),
    sa.Column('order', sa.Integer(), nullable=True),
    sa.Column('timestamp', sa.DateTime(), nullable=True),
    sa.ForeignKeyConstraint(['node_id'], ['node.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('button',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('rc_id', sa.Integer(), nullable=True),
    sa.Column('radio_id', sa.Integer(), nullable=True),
    sa.Column('name', sa.String(length=50), nullable=True),
    sa.Column('order_hor', sa.Integer(), nullable=True),
    sa.Column('order_ver', sa.Integer(), nullable=True),
    sa.Column('color', sa.String(length=10), nullable=True),
    sa.Column('type', sa.String(length=20), nullable=True),
    sa.Column('message', sa.Text(), nullable=True),
    sa.Column('timestamp', sa.DateTime(), nullable=True),
    sa.ForeignKeyConstraint(['rc_id'], ['rc.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('radio',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('arduino_id', sa.Integer(), nullable=True),
    sa.Column('pipe', sa.String(length=12), nullable=True),
    sa.Column('type', sa.String(length=20), nullable=True),
    sa.Column('name', sa.String(length=50), nullable=True),
    sa.Column('enabled', sa.Boolean(), nullable=True),
    sa.Column('order', sa.Integer(), nullable=True),
    sa.Column('on_request', sa.Boolean(), nullable=False),
    sa.Column('expired_after', sa.Integer(), nullable=True),
    sa.Column('timestamp', sa.DateTime(), nullable=True),
    sa.ForeignKeyConstraint(['arduino_id'], ['arduino.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('radio')
    op.drop_table('button')
    op.drop_table('arduino')
    op.drop_table('user')
    op.drop_table('rc')
    op.drop_table('node')
    # ### end Alembic commands ###
