0050_backfill_merge_strategy.py
python
sha256:1ccb8409daa5aabe577bd26d11b56ed12f3376d64011d0e75a247e81211a66ee
docs(mwp4/phase5): tick Phase 5 checkboxes, close musehub#109
Sonnet 4.6
21 days ago
| 1 | """Backfill NULL merge_strategy rows to 'state_overlay'. |
| 2 | |
| 3 | Every proposal is a merge operation and must have a strategy. NULL means the |
| 4 | row was created before the default was enforced. This migration backfills all |
| 5 | existing NULL values to the canonical default. |
| 6 | |
| 7 | Revision ID: 0050 |
| 8 | Revises: 0049 |
| 9 | """ |
| 10 | from __future__ import annotations |
| 11 | |
| 12 | import sqlalchemy as sa |
| 13 | from alembic import op |
| 14 | |
| 15 | revision: str = "0050" |
| 16 | down_revision: str = "0049" |
| 17 | branch_labels = None |
| 18 | depends_on = None |
| 19 | |
| 20 | |
| 21 | def upgrade() -> None: |
| 22 | op.execute( |
| 23 | sa.text( |
| 24 | "UPDATE musehub_proposals SET merge_strategy = 'state_overlay' " |
| 25 | "WHERE merge_strategy IS NULL" |
| 26 | ) |
| 27 | ) |
| 28 | |
| 29 | |
| 30 | def downgrade() -> None: |
| 31 | pass # NULL backfills are not reversible |
File History
2 commits
sha256:1ccb8409daa5aabe577bd26d11b56ed12f3376d64011d0e75a247e81211a66ee
docs(mwp4/phase5): tick Phase 5 checkboxes, close musehub#109
Sonnet 4.6
21 days ago
sha256:2c523da45351334b5c4dbefed4dc3dd553b3faa8737a4e6caf301e5dc82141be
test(mwp4): Phase 0 RED reproduction tests for RC-4 ordering race
Sonnet 4.6
21 days ago