GeoIntel release gates / Compile, test, contracts and builds (push) Successful in 1m49s
GeoIntel release gates / Python and npm vulnerability policy (push) Successful in 21s
GeoIntel release gates / Production AI image, SBOM and container scan (push) Successful in 5m39s
GeoIntel release gates / Deploy exact gated revision to Unraid (push) Failing after 58m43s
29 lines
1.1 KiB
Python
29 lines
1.1 KiB
Python
"""Add dataset reference and provenance metadata columns."""
|
|
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
revision = "202606120001"
|
|
down_revision = "20260611212435"
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
op.add_column("datasets", sa.Column("dataset_role", sa.Text(), nullable=False, server_default="source"))
|
|
op.add_column("datasets", sa.Column("source_name", sa.Text(), nullable=True))
|
|
op.add_column("datasets", sa.Column("reference_layer_name", sa.Text(), nullable=True))
|
|
op.add_column("datasets", sa.Column("source_metadata", sa.JSON(), nullable=True))
|
|
op.add_column("datasets", sa.Column("provenance_metadata", sa.JSON(), nullable=True))
|
|
op.add_column("datasets", sa.Column("imported_at", sa.DateTime(timezone=True), server_default=sa.text("NOW()"), nullable=False))
|
|
|
|
|
|
def downgrade() -> None:
|
|
op.drop_column("datasets", "imported_at")
|
|
op.drop_column("datasets", "provenance_metadata")
|
|
op.drop_column("datasets", "source_metadata")
|
|
op.drop_column("datasets", "reference_layer_name")
|
|
op.drop_column("datasets", "source_name")
|
|
op.drop_column("datasets", "dataset_role")
|