gabriel / musehub public
20260613_0054_88f73f3453d7_add_fetch_mpack_cache_table.py python
44 lines 1.8 KB
Raw
sha256:b495cfec8059b1f4f9a72993e26e611b559cf3cbf989b4a1121a31e7a99fc7ef fix: ORM↔migration drift — unique constraint, drop unused i… Sonnet 4.6 patch 7 days ago
1 """add fetch mpack cache table
2
3 Revision ID: 88f73f3453d7
4 Revises: 0071
5 Create Date: 2026-06-13 00:54:45.367701+00:00
6
7 """
8 from __future__ import annotations
9
10 from typing import Sequence, Union
11
12 from alembic import op
13 import sqlalchemy as sa
14
15
16 # revision identifiers, used by Alembic.
17 revision: str = '88f73f3453d7'
18 down_revision: Union[str, None] = '0071'
19 branch_labels: Union[str, Sequence[str], None] = None
20 depends_on: Union[str, Sequence[str], None] = None
21
22
23 def upgrade() -> None:
24 # ### commands auto generated by Alembic - please adjust! ###
25 op.drop_index(op.f('ix_fetch_mpack_cache_repo_tip'), table_name='musehub_fetch_mpack_cache')
26 op.create_unique_constraint('uq_fetch_mpack_cache_repo_tip', 'musehub_fetch_mpack_cache', ['repo_id', 'tip_commit_id'])
27 op.drop_index(op.f('ix_proposal_comments_author_user_id'), table_name='musehub_proposal_comments')
28 op.alter_column('musehub_proposals', 'merge_strategy',
29 existing_type=sa.VARCHAR(length=50),
30 server_default='overlay',
31 existing_nullable=False)
32 # ### end Alembic commands ###
33
34
35 def downgrade() -> None:
36 # ### commands auto generated by Alembic - please adjust! ###
37 op.alter_column('musehub_proposals', 'merge_strategy',
38 existing_type=sa.VARCHAR(length=50),
39 server_default=sa.text("'state_overlay'::character varying"),
40 existing_nullable=False)
41 op.create_index(op.f('ix_proposal_comments_author_user_id'), 'musehub_proposal_comments', ['author_user_id'], unique=False)
42 op.drop_constraint('uq_fetch_mpack_cache_repo_tip', 'musehub_fetch_mpack_cache', type_='unique')
43 op.create_index(op.f('ix_fetch_mpack_cache_repo_tip'), 'musehub_fetch_mpack_cache', ['repo_id', 'tip_commit_id'], unique=True)
44 # ### end Alembic commands ###
File History 1 commit
sha256:b495cfec8059b1f4f9a72993e26e611b559cf3cbf989b4a1121a31e7a99fc7ef fix: ORM↔migration drift — unique constraint, drop unused i… Sonnet 4.6 patch 7 days ago