This commit is contained in:
2026-01-24 16:13:37 +03:30
parent 64d6d1e391
commit 05edc9abb4
14 changed files with 240 additions and 50 deletions
+3 -2
View File
@@ -1,14 +1,15 @@
import { Cascade, Collection, Entity, OneToMany, PrimaryKey, Property } from '@mikro-orm/core';
import { Field } from './field.entity';
import { BaseEntity } from 'src/common/entities/base.entity';
@Entity({ tableName: 'section' })
export class Section {
export class Section extends BaseEntity {
@PrimaryKey({ type: 'bigint', autoincrement: true })
id: bigint
@OneToMany(() => Field, (attrValue) => attrValue.section, { cascade: [Cascade.PERSIST, Cascade.REMOVE] })
Fields = new Collection<Field>(this)
fields = new Collection<Field>(this)
@Property()
title: string;