fix(core): Prevent multiple values in the execution metadata for the same key and executionId (#9953)

This commit is contained in:
Danny Martini
2024-07-10 12:47:43 +02:00
committed by GitHub
parent 3a179439c7
commit 2e6b03b2cb
9 changed files with 203 additions and 15 deletions

View File

@@ -13,6 +13,8 @@ export class Column {
private defaultValue: unknown;
private primaryKeyConstraintName: string | undefined;
constructor(private name: string) {}
get bool() {
@@ -57,6 +59,12 @@ export class Column {
return this;
}
primaryWithName(name?: string) {
this.isPrimary = true;
this.primaryKeyConstraintName = name;
return this;
}
get notNull() {
this.isNullable = false;
return this;
@@ -74,12 +82,14 @@ export class Column {
// eslint-disable-next-line complexity
toOptions(driver: Driver): TableColumnOptions {
const { name, type, isNullable, isPrimary, isGenerated, length } = this;
const { name, type, isNullable, isPrimary, isGenerated, length, primaryKeyConstraintName } =
this;
const isMysql = 'mysql' in driver;
const isPostgres = 'postgres' in driver;
const isSqlite = 'sqlite' in driver;
const options: TableColumnOptions = {
primaryKeyConstraintName,
name,
isNullable,
isPrimary,