mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-13 05:47:31 -08:00
fix(core): Change WorkflowHistory nodes/connections columns to be json (#7282)
Github issue / Community forum post (link here to close automatically):
This commit is contained in:
parent
cde23a1bb1
commit
a80abad3af
|
@ -0,0 +1,15 @@
|
||||||
|
import type { MigrationContext, ReversibleMigration } from '@db/types';
|
||||||
|
|
||||||
|
const tableName = 'workflow_history';
|
||||||
|
|
||||||
|
export class ModifyWorkflowHistoryNodesAndConnections1695829275184 implements ReversibleMigration {
|
||||||
|
async up({ schemaBuilder: { addColumns, dropColumns, column } }: MigrationContext) {
|
||||||
|
await dropColumns(tableName, ['nodes', 'connections']);
|
||||||
|
await addColumns(tableName, [column('nodes').json.notNull, column('connections').json.notNull]);
|
||||||
|
}
|
||||||
|
|
||||||
|
async down({ schemaBuilder: { dropColumns, addColumns, column } }: MigrationContext) {
|
||||||
|
await dropColumns(tableName, ['nodes', 'connections']);
|
||||||
|
await addColumns(tableName, [column('nodes').text.notNull, column('connections').text.notNull]);
|
||||||
|
}
|
||||||
|
}
|
|
@ -49,6 +49,7 @@ import { CreateWorkflowHistoryTable1692967111175 } from '../common/1692967111175
|
||||||
import { DisallowOrphanExecutions1693554410387 } from '../common/1693554410387-DisallowOrphanExecutions';
|
import { DisallowOrphanExecutions1693554410387 } from '../common/1693554410387-DisallowOrphanExecutions';
|
||||||
import { ExecutionSoftDelete1693491613982 } from '../common/1693491613982-ExecutionSoftDelete';
|
import { ExecutionSoftDelete1693491613982 } from '../common/1693491613982-ExecutionSoftDelete';
|
||||||
import { AddWorkflowMetadata1695128658538 } from '../common/1695128658538-AddWorkflowMetadata';
|
import { AddWorkflowMetadata1695128658538 } from '../common/1695128658538-AddWorkflowMetadata';
|
||||||
|
import { ModifyWorkflowHistoryNodesAndConnections1695829275184 } from '../common/1695829275184-ModifyWorkflowHistoryNodesAndConnections';
|
||||||
|
|
||||||
export const mysqlMigrations: Migration[] = [
|
export const mysqlMigrations: Migration[] = [
|
||||||
InitialMigration1588157391238,
|
InitialMigration1588157391238,
|
||||||
|
@ -101,4 +102,5 @@ export const mysqlMigrations: Migration[] = [
|
||||||
DisallowOrphanExecutions1693554410387,
|
DisallowOrphanExecutions1693554410387,
|
||||||
ExecutionSoftDelete1693491613982,
|
ExecutionSoftDelete1693491613982,
|
||||||
AddWorkflowMetadata1695128658538,
|
AddWorkflowMetadata1695128658538,
|
||||||
|
ModifyWorkflowHistoryNodesAndConnections1695829275184,
|
||||||
];
|
];
|
||||||
|
|
|
@ -48,6 +48,7 @@ import { DisallowOrphanExecutions1693554410387 } from '../common/1693554410387-D
|
||||||
import { ExecutionSoftDelete1693491613982 } from '../common/1693491613982-ExecutionSoftDelete';
|
import { ExecutionSoftDelete1693491613982 } from '../common/1693491613982-ExecutionSoftDelete';
|
||||||
import { AddWorkflowMetadata1695128658538 } from '../common/1695128658538-AddWorkflowMetadata';
|
import { AddWorkflowMetadata1695128658538 } from '../common/1695128658538-AddWorkflowMetadata';
|
||||||
import { MigrateToTimestampTz1694091729095 } from './1694091729095-MigrateToTimestampTz';
|
import { MigrateToTimestampTz1694091729095 } from './1694091729095-MigrateToTimestampTz';
|
||||||
|
import { ModifyWorkflowHistoryNodesAndConnections1695829275184 } from '../common/1695829275184-ModifyWorkflowHistoryNodesAndConnections';
|
||||||
|
|
||||||
export const postgresMigrations: Migration[] = [
|
export const postgresMigrations: Migration[] = [
|
||||||
InitialMigration1587669153312,
|
InitialMigration1587669153312,
|
||||||
|
@ -99,4 +100,5 @@ export const postgresMigrations: Migration[] = [
|
||||||
ExecutionSoftDelete1693491613982,
|
ExecutionSoftDelete1693491613982,
|
||||||
AddWorkflowMetadata1695128658538,
|
AddWorkflowMetadata1695128658538,
|
||||||
MigrateToTimestampTz1694091729095,
|
MigrateToTimestampTz1694091729095,
|
||||||
|
ModifyWorkflowHistoryNodesAndConnections1695829275184,
|
||||||
];
|
];
|
||||||
|
|
|
@ -46,6 +46,7 @@ import { CreateWorkflowHistoryTable1692967111175 } from '../common/1692967111175
|
||||||
import { DisallowOrphanExecutions1693554410387 } from '../common/1693554410387-DisallowOrphanExecutions';
|
import { DisallowOrphanExecutions1693554410387 } from '../common/1693554410387-DisallowOrphanExecutions';
|
||||||
import { ExecutionSoftDelete1693491613982 } from './1693491613982-ExecutionSoftDelete';
|
import { ExecutionSoftDelete1693491613982 } from './1693491613982-ExecutionSoftDelete';
|
||||||
import { AddWorkflowMetadata1695128658538 } from '../common/1695128658538-AddWorkflowMetadata';
|
import { AddWorkflowMetadata1695128658538 } from '../common/1695128658538-AddWorkflowMetadata';
|
||||||
|
import { ModifyWorkflowHistoryNodesAndConnections1695829275184 } from '../common/1695829275184-ModifyWorkflowHistoryNodesAndConnections';
|
||||||
|
|
||||||
const sqliteMigrations: Migration[] = [
|
const sqliteMigrations: Migration[] = [
|
||||||
InitialMigration1588102412422,
|
InitialMigration1588102412422,
|
||||||
|
@ -95,6 +96,7 @@ const sqliteMigrations: Migration[] = [
|
||||||
DisallowOrphanExecutions1693554410387,
|
DisallowOrphanExecutions1693554410387,
|
||||||
ExecutionSoftDelete1693491613982,
|
ExecutionSoftDelete1693491613982,
|
||||||
AddWorkflowMetadata1695128658538,
|
AddWorkflowMetadata1695128658538,
|
||||||
|
ModifyWorkflowHistoryNodesAndConnections1695829275184,
|
||||||
];
|
];
|
||||||
|
|
||||||
export { sqliteMigrations };
|
export { sqliteMigrations };
|
||||||
|
|
Loading…
Reference in a new issue