Fix unique index created twice (#7718)
`isUnique` was passed to TypeORM's column creation API resulting in double index creation because it's already done via the decorator and then in `WorkspaceMigrationIndexFactory` It would be interesting to move it at this field level in a later step, which is why I also fixed `CompositeColumnActionFactory` to pass isUnique on the correct columns, even though it's being ignored later on
This commit is contained in:
@ -183,7 +183,10 @@ export class CompositeColumnActionFactory extends ColumnActionAbstractFactory<Co
|
||||
enum: enumOptions,
|
||||
isNullable:
|
||||
alteredFieldMetadata.isNullable || !alteredProperty.isRequired,
|
||||
isUnique: alteredFieldMetadata.isUnique ?? false,
|
||||
isUnique:
|
||||
(alteredFieldMetadata.isUnique &&
|
||||
alteredProperty.isIncludedInUniqueConstraint) ??
|
||||
false,
|
||||
defaultValue: serializedDefaultValue,
|
||||
isArray:
|
||||
alteredProperty.type === FieldMetadataType.MULTI_SELECT ||
|
||||
|
||||
Reference in New Issue
Block a user