"""Add global_render_positions table.

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

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


def upgrade() -> None:
    op.create_table(
        "global_render_positions",
        sa.Column("id", UUID(as_uuid=True), primary_key=True, server_default=sa.text("gen_random_uuid()")),
        sa.Column("name", sa.String(200), nullable=False),
        sa.Column("rotation_x", sa.Float, nullable=False, server_default="0.0"),
        sa.Column("rotation_y", sa.Float, nullable=False, server_default="0.0"),
        sa.Column("rotation_z", sa.Float, nullable=False, server_default="0.0"),
        sa.Column("is_default", sa.Boolean, nullable=False, server_default="false"),
        sa.Column("sort_order", sa.Integer, nullable=False, server_default="0"),
        sa.Column("created_at", sa.DateTime, nullable=False, server_default=sa.text("now()")),
        sa.Column("updated_at", sa.DateTime, nullable=False, server_default=sa.text("now()")),
    )


def downgrade() -> None:
    op.drop_table("global_render_positions")
