diff --git a/datagateway_api/common/database/helpers.py b/datagateway_api/common/database/helpers.py index 2c404cfd..2e74ae37 100644 --- a/datagateway_api/common/database/helpers.py +++ b/datagateway_api/common/database/helpers.py @@ -388,9 +388,9 @@ def __init__(self, instrument_id): investigation_instrument = aliased(INSTRUMENT) self.base_query = ( self.base_query.join(FACILITYCYCLE.FACILITY) - .join(FACILITY.INSTRUMENT) - .join(FACILITY.INVESTIGATION) - .join(INVESTIGATION.INVESTIGATIONINSTRUMENT) + .join(FACILITY.instruments) + .join(FACILITY.investigations) + .join(INVESTIGATION.investigationInstruments) .join(investigation_instrument, INVESTIGATIONINSTRUMENT.INSTRUMENT) .filter(INSTRUMENT.id == instrument_id) .filter(investigation_instrument.id == INSTRUMENT.id) @@ -419,9 +419,9 @@ def __init__(self, instrument_id): investigation_instrument = aliased(INSTRUMENT) self.base_query = ( self.base_query.join(FACILITYCYCLE.FACILITY) - .join(FACILITY.INSTRUMENT) - .join(FACILITY.INVESTIGATION) - .join(INVESTIGATION.INVESTIGATIONINSTRUMENT) + .join(FACILITY.instruments) + .join(FACILITY.investigations) + .join(INVESTIGATION.investigationInstruments) .join(investigation_instrument, INVESTIGATIONINSTRUMENT.INSTRUMENT) .filter(INSTRUMENT.id == instrument_id) .filter(investigation_instrument.id == INSTRUMENT.id) @@ -452,9 +452,9 @@ def __init__(self, instrument_id, facility_cycle_id): investigation_instrument = aliased(INSTRUMENT) self.base_query = ( self.base_query.join(INVESTIGATION.FACILITY) - .join(FACILITY.FACILITYCYCLE) - .join(FACILITY.INSTRUMENT) - .join(INVESTIGATION.INVESTIGATIONINSTRUMENT) + .join(FACILITY.facilityCycles) + .join(FACILITY.instruments) + .join(INVESTIGATION.investigationInstruments) .join(investigation_instrument, INVESTIGATIONINSTRUMENT.INSTRUMENT) .filter(INSTRUMENT.id == instrument_id) .filter(FACILITYCYCLE.id == facility_cycle_id) @@ -489,9 +489,9 @@ def __init__(self, instrument_id, facility_cycle_id): investigation_instrument = aliased(INSTRUMENT) self.base_query = ( self.base_query.join(INVESTIGATION.FACILITY) - .join(FACILITY.FACILITYCYCLE) - .join(FACILITY.INSTRUMENT) - .join(INVESTIGATION.INVESTIGATIONINSTRUMENT) + .join(FACILITY.facilityCycles) + .join(FACILITY.instruments) + .join(INVESTIGATION.investigationInstruments) .join(investigation_instrument, INVESTIGATIONINSTRUMENT.INSTRUMENT) .filter(INSTRUMENT.id == instrument_id) .filter(FACILITYCYCLE.id == facility_cycle_id)