gabriel / musehub public
0049_proposal_snapshot_anchors.py python
33 lines 824 B
Raw
sha256:c2e5cf2d754ed2fe9a94e879d41ad12ff221d2ac4ac7b45247fcb981c76858bf docs: Section 8 database/migrations/backups — verified live… Sonnet 5 24 days ago
1 """Add from_snapshot_id and to_snapshot_id to musehub_proposals.
2
3 Captures the HEAD commit ID of each branch at proposal creation time,
4 providing cryptographic anchors for FROM STATE and TO STATE.
5
6 Revision ID: 0049
7 Revises: 0048
8 """
9 from __future__ import annotations
10
11 import sqlalchemy as sa
12 from alembic import op
13
14 revision: str = "0049"
15 down_revision: str = "0048"
16 branch_labels = None
17 depends_on = None
18
19
20 def upgrade() -> None:
21 op.add_column(
22 "musehub_proposals",
23 sa.Column("from_snapshot_id", sa.String(128), nullable=True),
24 )
25 op.add_column(
26 "musehub_proposals",
27 sa.Column("to_snapshot_id", sa.String(128), nullable=True),
28 )
29
30
31 def downgrade() -> None:
32 op.drop_column("musehub_proposals", "to_snapshot_id")
33 op.drop_column("musehub_proposals", "from_snapshot_id")
File History 2 commits
sha256:c2e5cf2d754ed2fe9a94e879d41ad12ff221d2ac4ac7b45247fcb981c76858bf docs: Section 8 database/migrations/backups — verified live… Sonnet 5 24 days ago
sha256:80e1a60a39562f6e616aaafbb27487f03abbec7d8ffc6164302b7a0c0bfc63ee docs: check off Section 0 items verified in inventory doc, … Sonnet 5 24 days ago