"""empty message

Revision ID: 803063a4c0ba
Revises: 
Create Date: 2019-05-25 14:10:38.684961

"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql

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


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('parties',
    sa.Column('party_id', sa.Integer(), nullable=False),
    sa.Column('party_name', sa.String(), nullable=True),
    sa.PrimaryKeyConstraint('party_id')
    )
    op.create_table('quotations',
    sa.Column('quotation_id', sa.Integer(), nullable=False),
    sa.Column('quotation', sa.String(), nullable=True),
    sa.Column('party_id', sa.Integer(), nullable=True),
    sa.Column('election', sa.String(), nullable=True),
    sa.ForeignKeyConstraint(['party_id'], ['parties.party_id'], ),
    sa.PrimaryKeyConstraint('quotation_id')
    )
    op.create_table('sessions',
    sa.Column('session_id', postgresql.UUID(as_uuid=True), nullable=False),
    sa.Column('party_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['party_id'], ['parties.party_id'], ),
    sa.PrimaryKeyConstraint('session_id')
    )
    op.create_table('answers',
    sa.Column('answer_id', sa.Integer(), nullable=False),
    sa.Column('quotation_id', sa.Integer(), nullable=True),
    sa.Column('session_id', postgresql.UUID(as_uuid=True), nullable=True),
    sa.Column('party_id_guess', sa.Integer(), nullable=True),
    sa.Column('created_at', sa.DateTime(timezone=True), server_default=sa.text('now()'), nullable=True),
    sa.ForeignKeyConstraint(['party_id_guess'], ['parties.party_id'], ),
    sa.ForeignKeyConstraint(['quotation_id'], ['quotations.quotation_id'], ),
    sa.ForeignKeyConstraint(['session_id'], ['sessions.session_id'], ),
    sa.PrimaryKeyConstraint('answer_id')
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('answers')
    op.drop_table('sessions')
    op.drop_table('quotations')
    op.drop_table('parties')
    # ### end Alembic commands ###
