mirror of
https://github.com/n8n-io/n8n.git
synced 2025-02-21 02:56:40 -08: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:
parent
dd652c0b0d
commit
3a435f7057
|
@ -5,6 +5,8 @@ import { logMigrationEnd, logMigrationStart } from '@db/utils/migrationHelpers';
|
||||||
export class AddUserSettings1652367743993 implements MigrationInterface {
|
export class AddUserSettings1652367743993 implements MigrationInterface {
|
||||||
name = 'AddUserSettings1652367743993';
|
name = 'AddUserSettings1652367743993';
|
||||||
|
|
||||||
|
transaction = false;
|
||||||
|
|
||||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||||
logMigrationStart(this.name);
|
logMigrationStart(this.name);
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,12 @@
|
||||||
import { MigrationInterface, QueryRunner } from 'typeorm';
|
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||||
import config from '@/config';
|
import config from '@/config';
|
||||||
import { logMigrationEnd, logMigrationStart } from '@db/utils/migrationHelpers';
|
import { logMigrationEnd, logMigrationStart } from '@db/utils/migrationHelpers';
|
||||||
|
|
||||||
export class AddAPIKeyColumn1652905585850 implements MigrationInterface {
|
export class AddAPIKeyColumn1652905585850 implements MigrationInterface {
|
||||||
name = 'AddAPIKeyColumn1652905585850';
|
name = 'AddAPIKeyColumn1652905585850';
|
||||||
|
|
||||||
|
transaction = false;
|
||||||
|
|
||||||
async up(queryRunner: QueryRunner): Promise<void> {
|
async up(queryRunner: QueryRunner): Promise<void> {
|
||||||
logMigrationStart(this.name);
|
logMigrationStart(this.name);
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,9 @@ import { getTablePrefix, logMigrationEnd, logMigrationStart } from '@db/utils/mi
|
||||||
|
|
||||||
export class DeleteExecutionsWithWorkflows1673268682475 implements MigrationInterface {
|
export class DeleteExecutionsWithWorkflows1673268682475 implements MigrationInterface {
|
||||||
name = 'DeleteExecutionsWithWorkflows1673268682475';
|
name = 'DeleteExecutionsWithWorkflows1673268682475';
|
||||||
|
|
||||||
|
transaction = false;
|
||||||
|
|
||||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||||
logMigrationStart(this.name);
|
logMigrationStart(this.name);
|
||||||
const tablePrefix = getTablePrefix();
|
const tablePrefix = getTablePrefix();
|
||||||
|
|
Loading…
Reference in a new issue