mirror of
https://github.com/strapi/strapi.git
synced 2025-12-28 15:44:59 +00:00
Ensure the session primary key check is disabled during schema update
Signed-off-by: Derrick Mehaffy <derrickmehaffy@gmail.com>
This commit is contained in:
parent
c5bcdd8dcb
commit
9445117c27
@ -41,7 +41,12 @@ class MysqlDialect extends Dialect {
|
||||
}
|
||||
|
||||
async startSchemaUpdate() {
|
||||
await this.db.connection.raw(`set foreign_key_checks = 0;`);
|
||||
try {
|
||||
await this.db.connection.raw(`set foreign_key_checks = 0;`);
|
||||
await this.db.connection.raw(`set session sql_require_primary_key = 0;`);
|
||||
} catch (err) {
|
||||
// Ignore error due to lack of session permissions
|
||||
}
|
||||
}
|
||||
|
||||
async endSchemaUpdate() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user