Skip to content

Commit a5943d8

Browse files
committed
feat(migrations): new migration script to drop minor trace chemistry sample/analyte unique constraint
1 parent 8c26bc1 commit a5943d8

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
"""drop minor trace chemistry unique constraint
2+
3+
Revision ID: 5336a52336df
4+
Revises: e71807682f57
5+
Create Date: 2026-02-18 14:22:00.874725
6+
7+
"""
8+
9+
from typing import Sequence, Union
10+
11+
from alembic import op
12+
13+
14+
# revision identifiers, used by Alembic.
15+
revision: str = "5336a52336df"
16+
down_revision: Union[str, Sequence[str], None] = "e71807682f57"
17+
branch_labels: Union[str, Sequence[str], None] = None
18+
depends_on: Union[str, Sequence[str], None] = None
19+
20+
21+
def upgrade() -> None:
22+
"""Upgrade schema."""
23+
op.drop_constraint(
24+
"uq_minor_trace_chemistry_sample_analyte",
25+
"NMA_MinorTraceChemistry",
26+
type_="unique",
27+
)
28+
29+
30+
def downgrade() -> None:
31+
"""Downgrade schema."""
32+
op.create_unique_constraint(
33+
"uq_minor_trace_chemistry_sample_analyte",
34+
"NMA_MinorTraceChemistry",
35+
["chemistry_sample_info_id", "analyte"],
36+
)

0 commit comments

Comments
 (0)