"""empty message

Revision ID: db597c1ba2e8
Revises: 
Create Date: 2019-10-09 20:18:37.949779

"""
from alembic import op
import sqlalchemy as sa


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


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('locations',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=128), nullable=True),
    sa.Column('coordinates', sa.String(length=256), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('devices',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=128), nullable=True),
    sa.Column('mac_address', sa.String(length=20), nullable=True),
    sa.Column('detailed_location', sa.String(length=128), nullable=True),
    sa.Column('location_id', sa.Integer(), nullable=True),
    sa.Column('token', sa.String(length=64), nullable=True),
    sa.ForeignKeyConstraint(['location_id'], ['locations.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('data',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('time', sa.Integer(), nullable=True),
    sa.Column('device_id', sa.Integer(), nullable=True),
    sa.Column('packet_count', sa.Integer(), nullable=True),
    sa.Column('mac_count', sa.Integer(), nullable=True),
    sa.Column('universal_mac_count', sa.Integer(), nullable=True),
    sa.Column('crowdedness', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['device_id'], ['devices.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ###


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