section
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user