"""Add global_render_position_id FK to order_lines.

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

revision = "056"
down_revision = "055"
branch_labels = None
depends_on = None


def upgrade() -> None:
    op.add_column(
        "order_lines",
        sa.Column(
            "global_render_position_id",
            UUID(as_uuid=True),
            sa.ForeignKey("global_render_positions.id", ondelete="SET NULL"),
            nullable=True,
        ),
    )


def downgrade() -> None:
    op.drop_column("order_lines", "global_render_position_id")
