"""empty message

Revision ID: d59ad87093e5
Revises: 
Create Date: 2021-02-11 17:50:57.991824

"""
from alembic import op
import sqlalchemy as sa


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


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('conversations',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('matchedId', sa.Integer(), nullable=False),
    sa.Column('messageText', sa.String(length=255), nullable=False),
    sa.Column('whichUser', sa.Boolean(), nullable=False),
    sa.Column('timeStamp', sa.DateTime(), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('matchedId'),
    sa.UniqueConstraint('messageText')
    )
    op.create_table('messages',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('userAccountId', sa.Integer(), nullable=False),
    sa.Column('timeStarted', sa.DateTime(), nullable=False),
    sa.Column('timeClosed', sa.DateTime(), nullable=False),
    sa.Column('userAccountId2', sa.Integer(), nullable=False),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('timeStarted')
    )
    op.create_table('users',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('username', sa.String(length=40), nullable=False),
    sa.Column('firstName', sa.String(length=40), nullable=False),
    sa.Column('lastName', sa.String(length=255), nullable=True),
    sa.Column('genderId', sa.Integer(), nullable=False),
    sa.Column('bio', sa.String(length=200), nullable=True),
    sa.Column('nickname', sa.String(length=200), nullable=True),
    sa.Column('email', sa.String(length=255), nullable=False),
    sa.Column('hashed_password', sa.String(length=255), nullable=False),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('email'),
    sa.UniqueConstraint('firstName'),
    sa.UniqueConstraint('lastName'),
    sa.UniqueConstraint('username')
    )
    op.create_table('swipes',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('userId1', sa.Integer(), nullable=False),
    sa.Column('userId2', sa.Integer(), nullable=False),
    sa.Column('user1swipedRight', sa.Boolean(), nullable=False),
    sa.Column('user2swipedRight', sa.Boolean(), nullable=False),
    sa.ForeignKeyConstraint(['userId1'], ['users.id'], ),
    sa.ForeignKeyConstraint(['userId2'], ['users.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('userPhotos',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('userAccountId', sa.Integer(), nullable=False),
    sa.Column('url', sa.String(length=100), nullable=False),
    sa.ForeignKeyConstraint(['userAccountId'], ['users.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('userPhotos')
    op.drop_table('swipes')
    op.drop_table('users')
    op.drop_table('messages')
    op.drop_table('conversations')
    # ### end Alembic commands ###
