a lot of refactos
This commit is contained in:
@@ -40,14 +40,14 @@ function vectorsEqual(a, b) {
|
||||
async function findSimulationFixture(ctx) {
|
||||
const { guiDatabase, simDatabase } = ctx.databases
|
||||
const rows = await MySQLClient.poolExecute(ctx.db, `
|
||||
SELECT u.usr_uuid AS user_uuid,
|
||||
BIN_TO_UUID(s.sim_uuid) AS simulation_uuid
|
||||
FROM \`${guiDatabase}\`.users u
|
||||
INNER JOIN \`${guiDatabase}\`.simowners o ON o.own_usr_id = u.usr_id
|
||||
INNER JOIN \`${simDatabase}\`.simulations s ON o.own_sim_uuid = s.sim_uuid
|
||||
INNER JOIN \`${simDatabase}\`.edited_kf_store ekfs ON ekfs.ekfs_ekf_uuid = s.sim_root_kf_uuid
|
||||
GROUP BY u.usr_uuid, s.sim_uuid
|
||||
HAVING COUNT(ekfs.ekfs_agent_id) > 0
|
||||
SELECT usr_uuid AS user_uuid,
|
||||
BIN_TO_UUID(sim_uuid) AS simulation_uuid
|
||||
FROM \`${guiDatabase}\`.users
|
||||
INNER JOIN \`${guiDatabase}\`.simowners ON own_usr_id = usr_id
|
||||
INNER JOIN \`${simDatabase}\`.simulations ON own_sim_uuid = sim_uuid
|
||||
INNER JOIN \`${simDatabase}\`.edited_kf_store ON ekfs_ekf_uuid = sim_root_kf_uuid
|
||||
GROUP BY usr_uuid, sim_uuid
|
||||
HAVING COUNT(ekfs_agent_id) > 0
|
||||
LIMIT 1
|
||||
`)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user