38 lines
1.3 KiB
Python
38 lines
1.3 KiB
Python
"""store company-form approvals on the server
|
|
|
|
Until now the "approved / pending" state of the tour plan, standard tour plan and fare
|
|
chart lived in each browser's local storage: an Area Manager's approval was invisible to
|
|
the MR, and the PDF signature was whatever the browser sent. It is now a table.
|
|
|
|
Revision ID: k1a7c3d9f6b8
|
|
Revises: j0f6b2c8e5a7
|
|
Create Date: 2026-09-21
|
|
"""
|
|
|
|
from collections.abc import Sequence
|
|
|
|
import sqlalchemy as sa
|
|
|
|
from alembic import op
|
|
|
|
revision: str = "k1a7c3d9f6b8"
|
|
down_revision: str | None = "j0f6b2c8e5a7"
|
|
branch_labels: str | Sequence[str] | None = None
|
|
depends_on: str | Sequence[str] | None = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
op.create_table(
|
|
"form_approval",
|
|
sa.Column("table_name", sa.String(length=64), primary_key=True),
|
|
sa.Column("status", sa.String(length=10), nullable=False, server_default="draft"),
|
|
sa.Column("requested_by_user_id", sa.UUID(), sa.ForeignKey("user.id", ondelete="SET NULL"), nullable=True),
|
|
sa.Column("approved_by_user_id", sa.UUID(), sa.ForeignKey("user.id", ondelete="SET NULL"), nullable=True),
|
|
sa.Column("approved_by_name", sa.String(length=200), nullable=True),
|
|
sa.Column("updated_at", sa.DateTime(timezone=True), server_default=sa.text("now()"), nullable=False),
|
|
)
|
|
|
|
|
|
def downgrade() -> None:
|
|
op.drop_table("form_approval")
|