From 864fcd8a0ce35c8c42f45b6d4b3edb5dd9bf1e45 Mon Sep 17 00:00:00 2001 From: Naz Date: Mon, 1 Feb 2021 19:29:13 +1300 Subject: [PATCH] Removed settings populateDefaults pre-migration refs https://github.com/TryGhost/Ghost/issues/12568 refs https://github.com/TryGhost/Ghost/commit/5fbc40430bde2e2f975d95e7beb4f9ac2a546ccf - Having populateDefaults run before migrations creates a chicken and egg problem where populate defaults can create records that are "non-migratable" as happened in https://github.com/TryGhost/Ghost/issues/12026 --- core/server/data/migrations/hooks/migrate/before.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/core/server/data/migrations/hooks/migrate/before.js b/core/server/data/migrations/hooks/migrate/before.js index 4f86a1e313..18feffd03e 100644 --- a/core/server/data/migrations/hooks/migrate/before.js +++ b/core/server/data/migrations/hooks/migrate/before.js @@ -3,8 +3,5 @@ const models = require('../../../../models'); module.exports = function before() { models.init(); - return dbBackup.backup().then(() => { - // ensure that our default settings are created to limit possible db states in migrations - return models.Settings.populateDefaults(); - }); + return dbBackup.backup(); };