update entity id

This commit is contained in:
2026-02-05 10:08:37 +03:30
parent d4ae03fa4f
commit 068286e505
37 changed files with 185 additions and 209 deletions
@@ -1,4 +1,4 @@
import { Collection, Entity, Enum, ManyToOne, OneToMany, PrimaryKey, Property } from '@mikro-orm/core';
import { Collection, Entity, Enum, ManyToOne, OneToMany, OptionalProps, PrimaryKey, Property } from '@mikro-orm/core';
import { FieldOption } from './field-option.entity';
import { EntityType, FieldType } from '../interface/print';
import { BaseEntity } from 'src/common/entities/base.entity';
@@ -6,8 +6,7 @@ import { BaseEntity } from 'src/common/entities/base.entity';
@Entity({ tableName: 'field' })
export class Field extends BaseEntity {
@PrimaryKey({ type: 'bigint', autoincrement: true })
id: number
[OptionalProps]?: 'createdAt' | 'deletedAt'
@OneToMany(() => FieldOption, (attrValue) => attrValue.field)
options = new Collection<FieldOption>(this)
@@ -17,8 +16,8 @@ export class Field extends BaseEntity {
entityType: EntityType;
// Foreign key based on entityType
@Property({ type: 'bigint' })
entityId: number;
@Property({ type: 'string',columnType:'char(26)' })
entityId: string;
@Property()
name: string;