0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00

🐛 Fixed migration path from pre 2.28.x to 3.0.0 (#11268)

no issue

- Bug reported here https://forum.ghost.org/t/ghost-3-0-update-q-install-cannot-read-property-type-of-undefined/9659/3
- The issue happens when migrating from e.g. 2.28.x Ghost instance directly to 3.0
This commit is contained in:
Naz Gargol 2019-10-28 12:02:16 +01:00 committed by GitHub
parent 80e1530f7e
commit b1e20d2ad5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -13,7 +13,15 @@ function createColumnMigration({table, column, dbIsInCorrectState, operation, op
log(`${operationVerb} ${table}.${column}`);
if (!isInCorrectState) {
return operation(table, column, transacting);
// has to be passed directly in case of migration to 3.0
// ref: https://github.com/TryGhost/Ghost/commit/9d7190d69255ac011848c6bf654886be81abeedc#diff-c20cac44dad77922cf53ffd7b094cd8cL22
const columnSpec = {
type: 'bool',
nullable: false,
defaultTo: false
};
return operation(table, column, transacting, columnSpec);
}
});
};