"""view_group_by_lane

Revision: 0107
Revision ID: 3b7c458d8852
Revises: 187c2a740494
Create Date: 2017-10-14 12:36:53.838093

"""

# revision identifiers, used by Alembic.
revision = '3b7c458d8852'
down_revision = '187c2a740494'
branch_labels = None
depends_on = None

from alembic import op
import sqlalchemy as sa


def upgrade():
    op.add_column('views', sa.Column('lane_group_type_id', sa.Integer(), nullable=True))
    op.create_foreign_key(None, 'views', 'card_group_types', ['lane_group_type_id'], ['id'], ondelete='SET NULL')

    op.add_column('views', sa.Column('lane_group_by_attribute_id', sa.Integer(), nullable=True))
    op.create_foreign_key(None, 'views', 'attributes', ['lane_group_by_attribute_id'], ['id'], ondelete='SET NULL')


def downgrade():
    op.drop_column('views', 'lane_group_type_id')
    op.drop_column('views', 'lane_group_by_attribute_id')
