Attempting to generate sqlalchemy models via sqlacodegen leads to the following warning/error:
sqlacodegen mysql+pymysql://user:password@host:port/ispyb_build --noinflect > models.py
/Users/rjgildea/software/cctbx_py3/conda_base/lib/python3.8/site-packages/sqlalchemy/sql/ddl.py:1213: SAWarning: Cannot correctly sort tables; there are unresolvable cycles between tables "BLSample, BLSampleImage, BLSubSample, DataCollection, Screening, ScreeningOutput, ScreeningStrategy, ScreeningStrategySubWedge, ScreeningStrategyWedge", which is usually caused by mutually dependent foreign key constraints. Foreign key constraints involving these tables will not be considered; this warning may raise an error in a future release.
util.warn(
This appears to be the result of two circular foreign key references:
BLSample -> BLSubSample -> BLSampleImage -> BLSample (via BLSample.blSubSampleId)
and
DataCollection -> screeningStrategySubWedge -> ScreeningStrategyWedge -> ScreeningStrategy -> Screening -> DataCollection (via DataCollection.strategySubWedgeOrigId).
As far as I can tell, both BLSample.blSubSampleId and DataCollection.strategySubWedgeOrigId appear to be unused at DLS. I don't understand what purpose either column serves. Can these columns be removed from the table?
Attempting to generate sqlalchemy models via sqlacodegen leads to the following warning/error:
This appears to be the result of two circular foreign key references:
BLSample -> BLSubSample -> BLSampleImage -> BLSample(viaBLSample.blSubSampleId)and
DataCollection -> screeningStrategySubWedge -> ScreeningStrategyWedge -> ScreeningStrategy -> Screening -> DataCollection(viaDataCollection.strategySubWedgeOrigId).As far as I can tell, both
BLSample.blSubSampleIdandDataCollection.strategySubWedgeOrigIdappear to be unused at DLS. I don't understand what purpose either column serves. Can these columns be removed from the table?