"""Clinic report model

Revision ID: 4823423b12c7
Revises: 59acb03089d5
Create Date: 2015-01-14 16:26:38.231511

"""

# revision identifiers, used by Alembic.
revision = '4823423b12c7'
down_revision = '59acb03089d5'

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('clinic_reports',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('clinic_id', sa.Integer(), nullable=True),
                    sa.Column('period_id', sa.Integer(), nullable=True),
                    sa.Column('json_data', postgresql.JSON(), nullable=False),
                    sa.ForeignKeyConstraint(['clinic_id'], ['clinics.id'], ),
                    sa.ForeignKeyConstraint(
                        ['period_id'], ['reporting_periods.id'], ),
                    sa.PrimaryKeyConstraint('id')
                    )
    ### end Alembic commands ###


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