Merge pull request #14342 from strapi/fix/sqlite-pk-migration

Create id column as nullable to avoid conflict with default null values
This commit is contained in:
Alexandre BODIN 2022-09-07 16:46:43 +02:00 committed by GitHub
commit 786684f36c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -316,7 +316,7 @@ const createHelpers = (db) => {
debug(`Creating column ${addedColumn.name}`);
if (addedColumn.type === 'increments' && !db.dialect.canAddIncrements()) {
tableBuilder.integer(addedColumn.name).unsigned().notNullable();
tableBuilder.integer(addedColumn.name).unsigned();
tableBuilder.primary(addedColumn.name);
} else {
createColumn(tableBuilder, addedColumn);