forked from mtusi2026/mtusi2026lab5
formatted project by python-black
This commit is contained in:
@@ -11,7 +11,9 @@ depends_on = None
|
||||
|
||||
def upgrade() -> None:
|
||||
op.add_column("attachments", sa.Column("crop_key", sa.String(128), nullable=True))
|
||||
op.add_column("attachments", sa.Column("optimized_key", sa.String(128), nullable=True))
|
||||
op.add_column(
|
||||
"attachments", sa.Column("optimized_key", sa.String(128), nullable=True)
|
||||
)
|
||||
# Старый staging сменяется надёжным ready-оригиналом, но не теряется из журнала cleanup.
|
||||
op.execute("""
|
||||
INSERT INTO upload_intents (id, object_key)
|
||||
@@ -37,7 +39,11 @@ def upgrade() -> None:
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
active = op.get_bind().scalar(sa.text("SELECT count(*) FROM attachments WHERE status IN ('queued', 'processing')"))
|
||||
active = op.get_bind().scalar(
|
||||
sa.text(
|
||||
"SELECT count(*) FROM attachments WHERE status IN ('queued', 'processing')"
|
||||
)
|
||||
)
|
||||
if active:
|
||||
raise RuntimeError("Перед downgrade необходимо завершить активные задания")
|
||||
op.execute("""
|
||||
|
||||
Reference in New Issue
Block a user