"""empty message

Revision ID: 59765cc966ea
Revises: 
Create Date: 2017-02-04 03:54:40.631512

"""
from alembic import op
import sqlalchemy as sa


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


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('users',
    sa.Column('created', sa.DateTime(), nullable=False),
    sa.Column('updated', sa.DateTime(), nullable=False),
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('username', sa.String(length=64), nullable=True),
    sa.Column('password_hash', sa.String(length=128), nullable=True),
    sa.Column('email', sa.String(length=128), nullable=True),
    sa.Column('photo_url', sa.String(length=256), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_users_email'), 'users', ['email'], unique=False)
    op.create_index(op.f('ix_users_photo_url'), 'users', ['photo_url'], unique=False)
    op.create_index(op.f('ix_users_username'), 'users', ['username'], unique=False)
    op.create_table('requests',
    sa.Column('created', sa.DateTime(), nullable=False),
    sa.Column('updated', sa.DateTime(), nullable=False),
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('user_id', sa.Integer(), nullable=True),
    sa.Column('meal_type', sa.String(length=64), nullable=True),
    sa.Column('location_string', sa.String(length=128), nullable=True),
    sa.Column('meal_time', sa.String(length=32), nullable=True),
    sa.Column('latitude', sa.String(length=32), nullable=True),
    sa.Column('longitude', sa.String(length=32), nullable=True),
    sa.Column('filled', sa.Boolean(), nullable=True),
    sa.ForeignKeyConstraint(['user_id'], ['users.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_requests_location_string'), 'requests', ['location_string'], unique=False)
    op.create_index(op.f('ix_requests_meal_time'), 'requests', ['meal_time'], unique=False)
    op.create_index(op.f('ix_requests_meal_type'), 'requests', ['meal_type'], unique=False)
    op.create_table('proposals',
    sa.Column('created', sa.DateTime(), nullable=False),
    sa.Column('updated', sa.DateTime(), nullable=False),
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('request_id', sa.Integer(), nullable=True),
    sa.Column('user_id', sa.Integer(), nullable=True),
    sa.Column('accepted', sa.Boolean(), nullable=True),
    sa.ForeignKeyConstraint(['request_id'], ['requests.id'], ),
    sa.ForeignKeyConstraint(['user_id'], ['users.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_proposals_request_id'), 'proposals', ['request_id'], unique=False)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_proposals_request_id'), table_name='proposals')
    op.drop_table('proposals')
    op.drop_index(op.f('ix_requests_meal_type'), table_name='requests')
    op.drop_index(op.f('ix_requests_meal_time'), table_name='requests')
    op.drop_index(op.f('ix_requests_location_string'), table_name='requests')
    op.drop_table('requests')
    op.drop_index(op.f('ix_users_username'), table_name='users')
    op.drop_index(op.f('ix_users_photo_url'), table_name='users')
    op.drop_index(op.f('ix_users_email'), table_name='users')
    op.drop_table('users')
    # ### end Alembic commands ###
