"""empty message

Revision ID: 24629378c350
Revises: None
Create Date: 2015-02-24 21:44:18.401127

"""

# revision identifiers, used by Alembic.
revision = '24629378c350'
down_revision = None

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

def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('buyers',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(), nullable=True),
    sa.Column('slug', sa.String(), nullable=True),
    sa.Column('json', postgresql.JSON(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('sources',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(), nullable=True),
    sa.Column('mapper', sa.String(), nullable=True),
    sa.Column('url', sa.String(), nullable=True),
    sa.Column('last_update', sa.DateTime(), nullable=True),
    sa.Column('last_retrieve', sa.DateTime(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('releases',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('ocid', sa.String(), nullable=True),
    sa.Column('language', sa.String(), nullable=True),
    sa.Column('json', postgresql.JSON(), nullable=True),
    sa.Column('supplier', sa.String(), nullable=True),
    sa.Column('supplier_slug', sa.String(), nullable=True),
    sa.Column('dossier', sa.String(), nullable=True),
    sa.Column('decision', sa.String(), nullable=True),
    sa.Column('description', sa.String(), nullable=True),
    sa.Column('concat', sa.String(), nullable=True),
    sa.Column('date', sa.DateTime(), nullable=True),
    sa.Column('value', sa.Float(), nullable=True),
    sa.Column('buyer_id', sa.Integer(), nullable=True),
    sa.Column('source_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['buyer_id'], ['buyers.id'], ),
    sa.ForeignKeyConstraint(['source_id'], ['sources.id'], ondelete="CASCADE"),
    sa.PrimaryKeyConstraint('id')
    )
    ### end Alembic commands ###


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