"""Add wind parks

Revision ID: 305a3bcb149d
Revises: 72a06f26bf27
Create Date: 2016-08-03 21:16:36.009214

"""

# revision identifiers, used by Alembic.
revision = '305a3bcb149d'
down_revision = '72a06f26bf27'
branch_labels = None
depends_on = None

from alembic import op
import sqlalchemy as sa


def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('windparks',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=255), nullable=True),
    sa.Column('user_id', sa.Integer(), nullable=True),
    sa.Column('location_id', sa.Integer(), nullable=True),
    sa.Column('market_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['location_id'], ['locations.id'], ),
    sa.ForeignKeyConstraint(['market_id'], ['markets.id'], ),
    sa.ForeignKeyConstraint(['user_id'], ['user.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_windparks_location_id'), 'windparks', ['location_id'], unique=False)
    op.create_index(op.f('ix_windparks_user_id'), 'windparks', ['user_id'], unique=False)
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_windparks_user_id'), table_name='windparks')
    op.drop_index(op.f('ix_windparks_location_id'), table_name='windparks')
    op.drop_table('windparks')
    ### end Alembic commands ###
