Persist best efforts during import and add resumable backfill

This commit is contained in:
Peter Stockings
2026-10-02 14:05:37 +10:00
parent a82135bc89
commit 9145bf8e47
9 changed files with 317 additions and 16 deletions
@@ -0,0 +1,29 @@
"""Persist versioned running best efforts and route availability."""
import sqlalchemy as sa
from alembic import op
revision = "e57a0f824c61"
down_revision = "d81b97ae5401"
branch_labels = None
depends_on = None
def upgrade():
with op.batch_alter_table("activity") as batch_op:
batch_op.add_column(
sa.Column("best_efforts", sa.JSON(), nullable=False, server_default="[]")
)
batch_op.add_column(
sa.Column("efforts_version", sa.Integer(), nullable=False, server_default="0")
)
batch_op.add_column(
sa.Column("has_route", sa.Boolean(), nullable=False, server_default=sa.false())
)
def downgrade():
with op.batch_alter_table("activity") as batch_op:
batch_op.drop_column("has_route")
batch_op.drop_column("efforts_version")
batch_op.drop_column("best_efforts")