Skip to content

Commit 4b99dc4

Browse files
committed
feat: remove deprecated functional_ranges_deprecated_json column from ScoreCalibration model
1 parent 8c8292c commit 4b99dc4

File tree

2 files changed

+38
-3
lines changed

2 files changed

+38
-3
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
"""drop functional range jsonb
2+
3+
Revision ID: c770fa9e6e58
4+
Revises: 16beeb593513
5+
Create Date: 2025-11-17 22:19:22.440742
6+
7+
"""
8+
9+
import sqlalchemy as sa
10+
from sqlalchemy.dialects import postgresql
11+
12+
from alembic import op
13+
14+
# revision identifiers, used by Alembic.
15+
revision = "c770fa9e6e58"
16+
down_revision = "16beeb593513"
17+
branch_labels = None
18+
depends_on = None
19+
20+
21+
def upgrade():
22+
# ### commands auto generated by Alembic - please adjust! ###
23+
op.drop_column("score_calibrations", "functional_ranges_deprecated_json")
24+
# ### end Alembic commands ###
25+
26+
27+
def downgrade():
28+
# ### commands auto generated by Alembic - please adjust! ###
29+
op.add_column(
30+
"score_calibrations",
31+
sa.Column(
32+
"functional_ranges_deprecated_json",
33+
postgresql.JSONB(astext_type=sa.Text()),
34+
autoincrement=False,
35+
nullable=True,
36+
),
37+
)
38+
# ### end Alembic commands ###

src/mavedb/models/score_calibration.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@ class ScoreCalibration(Base):
4141
baseline_score = Column(Float, nullable=True)
4242
baseline_score_description = Column(String, nullable=True)
4343

44-
# Ranges and sources are stored as JSONB (intersection structure) to avoid complex joins for now.
45-
# ranges: list[ { label, description?, classification, range:[lower,upper], inclusive_lower_bound, inclusive_upper_bound } ]
46-
functional_ranges_deprecated_json = Column(JSONB(none_as_null=True), nullable=True)
4744
functional_ranges: Mapped[list["ScoreCalibrationFunctionalClassification"]] = relationship(
4845
"ScoreCalibrationFunctionalClassification",
4946
back_populates="calibration",

0 commit comments

Comments
 (0)