mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-10 06:34:05 -08:00
fix: Add schema to postgres migrations (hotfix) (#5218)
* fix: Add schema to postgres migrations
This commit is contained in:
parent
9ce526e784
commit
c5245dd387
|
@ -1,12 +1,11 @@
|
|||
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||
import { logMigrationEnd, logMigrationStart } from '@db/utils/migrationHelpers';
|
||||
import config from '@/config';
|
||||
import { getTablePrefix, logMigrationEnd, logMigrationStart } from '@db/utils/migrationHelpers';
|
||||
|
||||
export class DeleteExecutionsWithWorkflows1673268682475 implements MigrationInterface {
|
||||
name = 'DeleteExecutionsWithWorkflows1673268682475';
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
logMigrationStart(this.name);
|
||||
const tablePrefix = config.getEnv('database.tablePrefix');
|
||||
const tablePrefix = getTablePrefix();
|
||||
|
||||
await queryRunner.query(`ALTER TABLE \`${tablePrefix}execution_entity\` MODIFY workflowId INT`);
|
||||
|
||||
|
@ -31,7 +30,7 @@ export class DeleteExecutionsWithWorkflows1673268682475 implements MigrationInte
|
|||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
const tablePrefix = config.getEnv('database.tablePrefix');
|
||||
const tablePrefix = getTablePrefix();
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE \`${tablePrefix}execution_entity\`
|
||||
DROP FOREIGN KEY \`FK_${tablePrefix}execution_entity_workflowId\``,
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||
import { logMigrationEnd, logMigrationStart } from '@db/utils/migrationHelpers';
|
||||
import config from '@/config';
|
||||
import { getTablePrefix, logMigrationEnd, logMigrationStart } from '@db/utils/migrationHelpers';
|
||||
|
||||
export class DeleteExecutionsWithWorkflows1673268682475 implements MigrationInterface {
|
||||
name = 'DeleteExecutionsWithWorkflows1673268682475';
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
logMigrationStart(this.name);
|
||||
const tablePrefix = config.getEnv('database.tablePrefix');
|
||||
const tablePrefix = getTablePrefix();
|
||||
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE ${tablePrefix}execution_entity
|
||||
|
@ -38,7 +37,7 @@ export class DeleteExecutionsWithWorkflows1673268682475 implements MigrationInte
|
|||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
const tablePrefix = config.getEnv('database.tablePrefix');
|
||||
const tablePrefix = getTablePrefix();
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE ${tablePrefix}execution_entity
|
||||
DROP CONSTRAINT "FK_${tablePrefix}execution_entity_workflowId"`,
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||
import { logMigrationEnd, logMigrationStart } from '@db/utils/migrationHelpers';
|
||||
import config from '@/config';
|
||||
import { getTablePrefix, logMigrationEnd, logMigrationStart } from '@db/utils/migrationHelpers';
|
||||
|
||||
export class DeleteExecutionsWithWorkflows1673268682475 implements MigrationInterface {
|
||||
name = 'DeleteExecutionsWithWorkflows1673268682475';
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
logMigrationStart(this.name);
|
||||
const tablePrefix = config.getEnv('database.tablePrefix');
|
||||
const tablePrefix = getTablePrefix();
|
||||
|
||||
const workflowIds: Array<{ id: number }> = await queryRunner.query(`
|
||||
SELECT id FROM "${tablePrefix}workflow_entity"
|
||||
|
@ -64,7 +63,7 @@ export class DeleteExecutionsWithWorkflows1673268682475 implements MigrationInte
|
|||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
const tablePrefix = config.getEnv('database.tablePrefix');
|
||||
const tablePrefix = getTablePrefix();
|
||||
|
||||
await queryRunner.query(`DROP TABLE IF EXISTS "${tablePrefix}temporary_execution_entity"`);
|
||||
await queryRunner.query(
|
||||
|
|
Loading…
Reference in a new issue