mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
fix(core): Disable transactions on sqlite migrations that use PRAGMA foreign_keys (#5392)
`PRAGMA foreign_keys` is [a no-op within a sqlite transaction](https://www.sqlite.org/pragma.html#pragma_foreign_keys). This causes cascade deletes to happen when we create a new user table, and drop the old user table.
This commit is contained in:
committed by
GitHub
parent
dd652c0b0d
commit
3a435f7057
@@ -5,6 +5,8 @@ import { logMigrationEnd, logMigrationStart } from '@db/utils/migrationHelpers';
|
||||
export class AddUserSettings1652367743993 implements MigrationInterface {
|
||||
name = 'AddUserSettings1652367743993';
|
||||
|
||||
transaction = false;
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
logMigrationStart(this.name);
|
||||
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||
import config from '@/config';
|
||||
import { logMigrationEnd, logMigrationStart } from '@db/utils/migrationHelpers';
|
||||
|
||||
export class AddAPIKeyColumn1652905585850 implements MigrationInterface {
|
||||
name = 'AddAPIKeyColumn1652905585850';
|
||||
|
||||
transaction = false;
|
||||
|
||||
async up(queryRunner: QueryRunner): Promise<void> {
|
||||
logMigrationStart(this.name);
|
||||
|
||||
|
||||
@@ -3,6 +3,9 @@ import { getTablePrefix, logMigrationEnd, logMigrationStart } from '@db/utils/mi
|
||||
|
||||
export class DeleteExecutionsWithWorkflows1673268682475 implements MigrationInterface {
|
||||
name = 'DeleteExecutionsWithWorkflows1673268682475';
|
||||
|
||||
transaction = false;
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
logMigrationStart(this.name);
|
||||
const tablePrefix = getTablePrefix();
|
||||
|
||||
Reference in New Issue
Block a user