"""empty message

Revision ID: 52478b5f442f
Revises: 
Create Date: 2020-01-19 15:12:30.696740

"""
from alembic import op
import sqlalchemy as sa


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


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('category',
    sa.Column('category_id', sa.Integer(), nullable=False),
    sa.Column('category_name', sa.String(length=50), nullable=False),
    sa.PrimaryKeyConstraint('category_id')
    )
    op.create_table('fbuser',
    sa.Column('table_id', sa.Integer(), nullable=False),
    sa.Column('user_id', sa.Integer(), nullable=True),
    sa.Column('name', sa.String(length=100), nullable=True),
    sa.Column('last_name', sa.String(length=100), nullable=True),
    sa.Column('email', sa.String(length=80), nullable=True),
    sa.PrimaryKeyConstraint('table_id'),
    sa.UniqueConstraint('user_id')
    )
    op.create_table('user',
    sa.Column('user_id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=25), nullable=False),
    sa.Column('last_name', sa.String(length=25), nullable=False),
    sa.Column('email', sa.String(length=80), nullable=False),
    sa.Column('password', sa.String(length=20), nullable=False),
    sa.Column('birthday_date', sa.String(length=8), nullable=True),
    sa.PrimaryKeyConstraint('user_id'),
    sa.UniqueConstraint('email')
    )
    op.create_table('auth',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('token', sa.String(length=100), nullable=True),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.Column('is_valid', sa.Boolean(), nullable=True),
    sa.Column('login_user_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['login_user_id'], ['user.user_id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('calendar',
    sa.Column('calendar_id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=25), nullable=False),
    sa.Column('description', sa.String(length=300), nullable=True),
    sa.Column('calendar_id_owner', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['calendar_id_owner'], ['user.user_id'], ),
    sa.PrimaryKeyConstraint('calendar_id')
    )
    op.create_table('event',
    sa.Column('event_id', sa.Integer(), nullable=False),
    sa.Column('event_name', sa.String(length=100), nullable=False),
    sa.Column('description', sa.String(length=5000), nullable=True),
    sa.Column('start_time', sa.String(length=50), nullable=True),
    sa.Column('end_time', sa.String(length=50), nullable=True),
    sa.Column('city', sa.String(length=100), nullable=True),
    sa.Column('street', sa.String(length=100), nullable=True),
    sa.Column('lat', sa.Float(), nullable=True),
    sa.Column('longi', sa.Float(), nullable=True),
    sa.Column('is_canceled', sa.String(length=100), nullable=True),
    sa.Column('event_category', sa.String(), nullable=True),
    sa.Column('event_photo_url', sa.String(length=200), nullable=True),
    sa.ForeignKeyConstraint(['event_category'], ['category.category_name'], ),
    sa.PrimaryKeyConstraint('event_id'),
    sa.UniqueConstraint('event_id')
    )
    op.create_table('favorite',
    sa.Column('user_id', sa.Integer(), nullable=True),
    sa.Column('category_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['category_id'], ['category.category_id'], ),
    sa.ForeignKeyConstraint(['user_id'], ['user.user_id'], )
    )
    op.create_table('fbcalendar',
    sa.Column('calendar_id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=25), nullable=False),
    sa.Column('description', sa.String(length=300), nullable=True),
    sa.Column('calendar_id_owner', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['calendar_id_owner'], ['fbuser.user_id'], ),
    sa.PrimaryKeyConstraint('calendar_id')
    )
    op.create_table('fbfavorite',
    sa.Column('user_id', sa.Integer(), nullable=True),
    sa.Column('category_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['category_id'], ['category.category_id'], ),
    sa.ForeignKeyConstraint(['user_id'], ['fbuser.user_id'], )
    )
    op.create_table('attendance',
    sa.Column('calendar_id', sa.Integer(), nullable=True),
    sa.Column('event_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['calendar_id'], ['calendar.calendar_id'], ),
    sa.ForeignKeyConstraint(['event_id'], ['event.event_id'], )
    )
    op.create_table('fbattendance',
    sa.Column('calendar_id', sa.Integer(), nullable=True),
    sa.Column('event_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['calendar_id'], ['fbcalendar.calendar_id'], ),
    sa.ForeignKeyConstraint(['event_id'], ['event.event_id'], )
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('fbattendance')
    op.drop_table('attendance')
    op.drop_table('fbfavorite')
    op.drop_table('fbcalendar')
    op.drop_table('favorite')
    op.drop_table('event')
    op.drop_table('calendar')
    op.drop_table('auth')
    op.drop_table('user')
    op.drop_table('fbuser')
    op.drop_table('category')
    # ### end Alembic commands ###
