"""chats

Revision ID: 71dced2d6a91
Revises: c48c59a737e5
Create Date: 2020-04-16 21:03:31.967251

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '71dced2d6a91'
down_revision = 'c48c59a737e5'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('chat',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('user1', sa.String(length=64), nullable=True),
    sa.Column('user2', sa.String(length=64), nullable=True),
    sa.Column('chat', sa.String(length=640000), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_chat_chat'), 'chat', ['chat'], unique=True)
    op.create_index(op.f('ix_chat_user1'), 'chat', ['user1'], unique=True)
    op.create_index(op.f('ix_chat_user2'), 'chat', ['user2'], unique=True)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_chat_user2'), table_name='chat')
    op.drop_index(op.f('ix_chat_user1'), table_name='chat')
    op.drop_index(op.f('ix_chat_chat'), table_name='chat')
    op.drop_table('chat')
    # ### end Alembic commands ###
