Of all 6 SQL databases:
sandbox_metadata, pilot_agents aren't using foreign keys at all. This could lead to orphan data in the database for two reasons:
- if a pilot is deleted in the
PilotAgents table, all pilot related data like in JobToPilotMapping will not be deleted
- we could have an unknown
pilot_id in PilotOutput because we inserted a non-existent one (so we are obliged to verify that the new pilot_id exists in the database, manually, instead of letting the db verify for us and doing its magic) or because it does not exist anymore (see 1.)
I don't know if this is a choice, or a mistake. If it is a choice, task_queue and job do use foreign keys. And furthermore, even if we check manually, I think it is better to have constraints inside the DB itself, rather than constraints done before.
In the meanwhile, job_logging and auth can't use it, because the client_id is remotely defined in IAM if I recall.
Of all 6 SQL databases:
sandbox_metadata,pilot_agentsaren't using foreign keys at all. This could lead to orphan data in the database for two reasons:PilotAgentstable, all pilot related data like inJobToPilotMappingwill not be deletedpilot_idinPilotOutputbecause we inserted a non-existent one (so we are obliged to verify that the newpilot_idexists in the database, manually, instead of letting the db verify for us and doing its magic) or because it does not exist anymore (see 1.)I don't know if this is a choice, or a mistake. If it is a choice,
task_queueandjobdo use foreign keys. And furthermore, even if we check manually, I think it is better to have constraints inside the DB itself, rather than constraints done before.In the meanwhile,
job_loggingandauthcan't use it, because theclient_idis remotely defined inIAMif I recall.