"""Add workflow_definition_id FK to output_types.

Revision ID: 038
Revises: 037
"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects.postgresql import UUID

revision = '038'
down_revision = '037'
branch_labels = None
depends_on = None


def upgrade():
    op.add_column('output_types',
        sa.Column('workflow_definition_id', UUID(as_uuid=True),
                  sa.ForeignKey('workflow_definitions.id', ondelete='SET NULL'),
                  nullable=True)
    )


def downgrade():
    op.drop_column('output_types', 'workflow_definition_id')
