"""deal-and-org

Revision ID: a6a6cdd6ba67
Revises: 954def4c1b92
Create Date: 2018-10-04 22:40:23.085634

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

# revision identifiers, used by Alembic.
revision = 'a6a6cdd6ba67'
down_revision = '954def4c1b92'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('deal',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('collection', sa.Text(), nullable=False),
    sa.Column('deal_id', sa.Text(), nullable=False),
    sa.Column('date_loaded', sa.DateTime(), nullable=True),
    sa.Column('deal', postgresql.JSONB(astext_type=sa.Text()), nullable=False),
    sa.Column('metadata', postgresql.JSONB(astext_type=sa.Text()), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('organization',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('collection', sa.Text(), nullable=False),
    sa.Column('org_id', sa.Text(), nullable=False),
    sa.Column('date_loaded', sa.DateTime(), nullable=True),
    sa.Column('organization', postgresql.JSONB(astext_type=sa.Text()), nullable=False),
    sa.Column('metadata', postgresql.JSONB(astext_type=sa.Text()), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('orgainization')
    op.drop_table('deal')
    # ### end Alembic commands ###
