From d127b975afcefe9b3b1f3d11aa3ae55c04948a20 Mon Sep 17 00:00:00 2001 From: Daniel Lockyer Date: Wed, 7 Jun 2023 13:44:21 +0200 Subject: [PATCH] Disabled `autoRefresh` when inserting fixtures refs https://github.com/TryGhost/Toolbox/issues/592 - we don't need to receive the refreshed model back afterwards so we can save an SQL select per insert by disabling auto-refresh - this saves about 18000 DB queries for the MySQL tests, which should help reduce test time due to the overhead --- ghost/core/core/server/data/schema/fixtures/FixtureManager.js | 1 + 1 file changed, 1 insertion(+) diff --git a/ghost/core/core/server/data/schema/fixtures/FixtureManager.js b/ghost/core/core/server/data/schema/fixtures/FixtureManager.js index 7dd20fa87f..dbc8f749f5 100644 --- a/ghost/core/core/server/data/schema/fixtures/FixtureManager.js +++ b/ghost/core/core/server/data/schema/fixtures/FixtureManager.js @@ -69,6 +69,7 @@ class FixtureManager { */ async addAllFixtures(options) { const localOptions = _.merge({ + autoRefresh: false, context: {internal: true}, migrating: true }, options);