refactor: Use string ids on Credentials, Workflows, Tags, and Executions DB entities (#5041)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2023-01-02 17:42:32 +01:00
committed by GitHub
parent 8bee04cd2a
commit ee28213538
83 changed files with 468 additions and 645 deletions

View File

@@ -1,10 +1,13 @@
import { jsonParse } from 'n8n-workflow';
import { ValueTransformer } from 'typeorm';
import type { ValueTransformer, FindOperator } from 'typeorm';
import config from '@/config';
export const idStringifier = {
from: (value: number): string | number => (typeof value === 'number' ? value.toString() : value),
to: (value: string): number | string => (typeof value === 'string' ? Number(value) : value),
from: (value?: number): string | undefined => value?.toString(),
to: (
value: string | FindOperator<unknown> | undefined,
): number | FindOperator<unknown> | undefined =>
typeof value === 'string' ? Number(value) : value,
};
export const lowerCaser = {