Skip to content

Commit 52bf2a0

Browse files
gfrngithub-actions[bot]DiamondLightSource-build-server
authored
Bump schema version from v4.6.0 to v4.7.0 (#236)
* Bump schema version * Bump version: 11.0.2 → 11.0.3 * Update ISPyB ORM schema to database schema v4.7.0 (#237) Generated with sqlacodegen 3.0.0rc5 SQLAlchemy 2.0.40 Co-authored-by: ISPyB-API Azure build <[email protected]> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: ISPyB-API Azure build <[email protected]>
1 parent 6d983d8 commit 52bf2a0

File tree

8 files changed

+4578
-7
lines changed

8 files changed

+4578
-7
lines changed

.github/workflows/test-and-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
push:
55

66
env:
7-
DATABASE_SCHEMA: 4.6.0
7+
DATABASE_SCHEMA: 4.7.0
88

99
permissions:
1010
contents: read

HISTORY.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ History
55
Unreleased / main
66
-------------------
77

8+
11.0.3 (2025-05-12)
9+
-------------------
10+
11+
* Update database schema to v4.7.0
12+
813
11.0.2 (2025-03-13)
914
-------------------
1015

jupyterhub.sqlite

140 KB
Binary file not shown.

jupyterhub_cookie_secret

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
a3e4ed1be23ee9cbbdc446d4b466f2dd81fc141ddd94d584d306bbad94eb9b64

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "ispyb"
7-
version = "11.0.2"
7+
version = "11.0.3"
88
description = "Python package to access ISPyB database"
99
authors = [
1010
{ name = "Diamond Light Source", email = "[email protected]" },
@@ -59,7 +59,7 @@ unfixable = ["F841"]
5959
ignore = ["E501"]
6060

6161
[tool.bumpversion]
62-
current_version = "11.0.2"
62+
current_version = "11.0.3"
6363
commit = true
6464
tag = true
6565

src/ispyb/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import os
44
import warnings
55

6-
__version__ = "11.0.2"
6+
__version__ = "11.0.3"
77

88
_log = logging.getLogger("ispyb")
99

src/ispyb/sqlalchemy/_auto_db_schema.py

Lines changed: 68 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__schema_version__ = "4.6.0"
1+
__schema_version__ = "4.7.0"
22
import datetime
33
import decimal
44
from typing import List, Optional
@@ -3804,6 +3804,8 @@ class Shipping(Base):
38043804
ForeignKeyConstraint(
38053805
["deliveryAgent_flightCodePersonId"],
38063806
["Person.personId"],
3807+
ondelete="SET NULL",
3808+
onupdate="CASCADE",
38073809
name="Shipping_ibfk_4",
38083810
),
38093811
ForeignKeyConstraint(
@@ -3816,14 +3818,14 @@ class Shipping(Base):
38163818
ForeignKeyConstraint(
38173819
["returnLabContactId"],
38183820
["LabContact.labContactId"],
3819-
ondelete="CASCADE",
3821+
ondelete="SET NULL",
38203822
onupdate="CASCADE",
38213823
name="Shipping_ibfk_3",
38223824
),
38233825
ForeignKeyConstraint(
38243826
["sendingLabContactId"],
38253827
["LabContact.labContactId"],
3826-
ondelete="CASCADE",
3828+
ondelete="SET NULL",
38273829
onupdate="CASCADE",
38283830
name="Shipping_ibfk_2",
38293831
),
@@ -4166,6 +4168,7 @@ class DewarRegistryHasProposal(Base):
41664168
ForeignKeyConstraint(
41674169
["labContactId"],
41684170
["LabContact.labContactId"],
4171+
ondelete="SET NULL",
41694172
onupdate="CASCADE",
41704173
name="DewarRegistry_has_Proposal_ibfk4",
41714174
),
@@ -4677,6 +4680,9 @@ class BLSample(Base):
46774680
BLSampleImage: Mapped[List["BLSampleImage"]] = relationship(
46784681
"BLSampleImage", back_populates="BLSample"
46794682
)
4683+
BLSamplePosition: Mapped[List["BLSamplePosition"]] = relationship(
4684+
"BLSamplePosition", back_populates="BLSample"
4685+
)
46804686
BLSample_has_DataCollectionPlan: Mapped[List["BLSampleHasDataCollectionPlan"]] = (
46814687
relationship("BLSampleHasDataCollectionPlan", back_populates="BLSample")
46824688
)
@@ -4707,6 +4713,9 @@ class BLSample(Base):
47074713
XFEFluorescenceSpectrum: Mapped[List["XFEFluorescenceSpectrum"]] = relationship(
47084714
"XFEFluorescenceSpectrum", back_populates="BLSample"
47094715
)
4716+
XrayCentringResult: Mapped[List["XrayCentringResult"]] = relationship(
4717+
"XrayCentringResult", back_populates="BLSample"
4718+
)
47104719
BLSample_has_EnergyScan: Mapped[List["BLSampleHasEnergyScan"]] = relationship(
47114720
"BLSampleHasEnergyScan", back_populates="BLSample"
47124721
)
@@ -4962,6 +4971,39 @@ class BLSampleImage(Base):
49624971
)
49634972

49644973

4974+
class BLSamplePosition(Base):
4975+
__tablename__ = "BLSamplePosition"
4976+
__table_args__ = (
4977+
ForeignKeyConstraint(
4978+
["blSampleId"],
4979+
["BLSample.blSampleId"],
4980+
name="BLSamplePosition_fk_blSampleId",
4981+
),
4982+
Index("BLSamplePosition_fk_blSampleId", "blSampleId"),
4983+
)
4984+
4985+
blSamplePositionId: Mapped[int] = mapped_column(
4986+
INTEGER(11), primary_key=True, comment="Primary key (auto-incremented)"
4987+
)
4988+
blSampleId: Mapped[int] = mapped_column(
4989+
INTEGER(11), comment="FK, references parent sample"
4990+
)
4991+
posX: Mapped[Optional[decimal.Decimal]] = mapped_column(Double(asdecimal=True))
4992+
posY: Mapped[Optional[decimal.Decimal]] = mapped_column(Double(asdecimal=True))
4993+
posZ: Mapped[Optional[decimal.Decimal]] = mapped_column(Double(asdecimal=True))
4994+
recordTimeStamp: Mapped[Optional[datetime.datetime]] = mapped_column(
4995+
DateTime, comment="Creation or last update date/time"
4996+
)
4997+
positionType: Mapped[Optional[str]] = mapped_column(
4998+
Enum("dispensing"),
4999+
comment="Type of marked position (e.g.: dispensing location)",
5000+
)
5001+
5002+
BLSample: Mapped["BLSample"] = relationship(
5003+
"BLSample", back_populates="BLSamplePosition"
5004+
)
5005+
5006+
49655007
class BLSampleHasDataCollectionPlan(Base):
49665008
__tablename__ = "BLSample_has_DataCollectionPlan"
49675009
__table_args__ = (
@@ -6221,13 +6263,21 @@ class XFEFluorescenceSpectrum(Base):
62216263
class XrayCentringResult(Base):
62226264
__tablename__ = "XrayCentringResult"
62236265
__table_args__ = (
6266+
ForeignKeyConstraint(
6267+
["blSampleId"],
6268+
["BLSample.blSampleId"],
6269+
ondelete="SET NULL",
6270+
onupdate="CASCADE",
6271+
name="XrayCentringResult_fk_blSampleId",
6272+
),
62246273
ForeignKeyConstraint(
62256274
["xrayCentringId"],
62266275
["XrayCentring.xrayCentringId"],
62276276
ondelete="CASCADE",
62286277
onupdate="CASCADE",
62296278
name="XrayCentringResult_ibfk_1",
62306279
),
6280+
Index("XrayCentringResult_fk_blSampleId", "blSampleId"),
62316281
Index("xrayCentringId", "xrayCentringId"),
62326282
{"comment": "Xray Centring result."},
62336283
)
@@ -6297,7 +6347,14 @@ class XrayCentringResult(Base):
62976347
gridInfoId: Mapped[Optional[int]] = mapped_column(
62986348
INTEGER(11), comment="to be removed"
62996349
)
6350+
blSampleId: Mapped[Optional[int]] = mapped_column(
6351+
INTEGER(11),
6352+
comment="The BLSample attributed for this x-ray centring result, i.e. the actual sample even for multi-pins",
6353+
)
63006354

6355+
BLSample: Mapped["BLSample"] = relationship(
6356+
"BLSample", back_populates="XrayCentringResult"
6357+
)
63016358
XrayCentring: Mapped["XrayCentring"] = relationship(
63026359
"XrayCentring", back_populates="XrayCentringResult"
63036360
)
@@ -8449,6 +8506,14 @@ class ParticleClassification(Base):
84498506
Float,
84508507
comment="Quadratic coefficient of quadratic fit to refinement resolution against the logarithm of the number of particles",
84518508
)
8509+
angularEfficiency: Mapped[Optional[decimal.Decimal]] = mapped_column(
8510+
Double(asdecimal=True),
8511+
comment="Variation in resolution across different angles, 1-2sig/mean",
8512+
)
8513+
suggestedTilt: Mapped[Optional[decimal.Decimal]] = mapped_column(
8514+
Double(asdecimal=True),
8515+
comment="Suggested stage tilt angle to improve angular efficiency. Unit: degrees",
8516+
)
84528517

84538518
CryoemInitialModel: Mapped[List["CryoemInitialModel"]] = relationship(
84548519
"CryoemInitialModel",

0 commit comments

Comments
 (0)