mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
fix: Run every DB migration inside a transaction (#5129)
* always each DB migrations in a transaction * `VACUUM` isn't allowed inside transactions. * `PRAGMA foreign_keys` are automatically toggled before and after every down migration
This commit is contained in:
committed by
GitHub
parent
a573db2ef7
commit
62cce2e518
@@ -132,6 +132,7 @@ export async function init(
|
||||
synchronize: false,
|
||||
logging: loggingOption,
|
||||
maxQueryExecutionTime,
|
||||
migrationsTransactionMode: 'each',
|
||||
});
|
||||
|
||||
connection = await createConnection(connectionOptions);
|
||||
@@ -151,9 +152,7 @@ export async function init(
|
||||
|
||||
// If you remove this call, remember to turn back on the
|
||||
// setting to run migrations automatically above.
|
||||
await connection.runMigrations({
|
||||
transaction: 'none',
|
||||
});
|
||||
await connection.runMigrations();
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
||||
if (migrations.length === 0) {
|
||||
|
||||
Reference in New Issue
Block a user