"""empty message

Revision ID: dd12345cd4e9
Revises: 
Create Date: 2020-01-31 15:28:52.194801

"""
from alembic import op
import sqlalchemy as sa


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


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('admin',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=256), nullable=True),
    sa.Column('chat_id', sa.Integer(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('claimant',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=256), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('name')
    )
    op.create_table('friend',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=256), nullable=True),
    sa.Column('chat_id', sa.Integer(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('link',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('from_chat_id', sa.Integer(), nullable=True),
    sa.Column('source_message_id', sa.Integer(), nullable=True),
    sa.Column('current_message_id', sa.Integer(), nullable=True),
    sa.Column('claimant', sa.String(length=256), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('message',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('tlg_chat_id', sa.Integer(), nullable=True),
    sa.Column('tlg_msg_id', sa.Integer(), nullable=True),
    sa.Column('text', sa.String(length=12000), nullable=True),
    sa.Column('from_claimant', sa.Boolean(), nullable=True),
    sa.Column('from_user', sa.String(length=256), nullable=True),
    sa.Column('to_user', sa.String(length=256), nullable=True),
    sa.Column('timestamp', sa.DateTime(), nullable=True),
    sa.Column('media_group_id', sa.String(length=256), nullable=True),
    sa.Column('_file_ids', sa.String(length=15000), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_message_timestamp'), 'message', ['timestamp'], unique=False)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_message_timestamp'), table_name='message')
    op.drop_table('message')
    op.drop_table('link')
    op.drop_table('friend')
    op.drop_table('claimant')
    op.drop_table('admin')
    # ### end Alembic commands ###
