"""empty message

Revision ID: 7730292c6b81
Revises: 
Create Date: 2018-12-22 14:13:47.403875

"""
from alembic import op
import sqlalchemy as sa


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


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('account',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('Username', sa.String(length=30), nullable=True),
    sa.Column('PWD', sa.String(length=20), nullable=True),
    sa.Column('email', sa.String(length=25), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('Username'),
    sa.UniqueConstraint('email')
    )
    op.create_table('info',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('email', sa.String(length=25), nullable=True),
    sa.Column('timestamp', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['email'], ['account.email'], ),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('timestamp')
    )
    op.create_table('tmp',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('timestamp', sa.Integer(), nullable=True),
    sa.Column('nowtime', sa.Integer(), nullable=True),
    sa.Column('longitude', sa.Float(), nullable=True),
    sa.Column('latitude', sa.Float(), nullable=True),
    sa.Column('fallen', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['timestamp'], ['info.timestamp'], ),
    sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('tmp')
    op.drop_table('info')
    op.drop_table('account')
    # ### end Alembic commands ###
