Mechanical, whole-tree `ruff format` pass — no behaviour change. Recorded in .git-blame-ignore-revs (next commit) so git blame skips it.
31 lines
871 B
Python
31 lines
871 B
Python
"""media_assets.gc_notified flag for one-shot pre-expiry warnings
|
|
|
|
Revision ID: 0038_asset_gc_notified
|
|
Revises: 0037_dl_builtin_profiles
|
|
Create Date: 2026-07-03
|
|
|
|
The download GC warns each holder once, a grace window before an asset's TTL expiry; this flag
|
|
records that so subsequent GC runs don't re-notify until the asset is deleted.
|
|
"""
|
|
|
|
from typing import Sequence, Union
|
|
|
|
import sqlalchemy as sa
|
|
from alembic import op
|
|
|
|
revision: str = "0038_asset_gc_notified"
|
|
down_revision: Union[str, None] = "0037_dl_builtin_profiles"
|
|
branch_labels: Union[str, Sequence[str], None] = None
|
|
depends_on: Union[str, Sequence[str], None] = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
op.add_column(
|
|
"media_assets",
|
|
sa.Column("gc_notified", sa.Boolean(), server_default="false", nullable=False),
|
|
)
|
|
|
|
|
|
def downgrade() -> None:
|
|
op.drop_column("media_assets", "gc_notified")
|