S
Size: a a a
S
BK
S
S
MS
AU
MS
АБ
useUnifiedTopology: true || false в конфигурации<

КБ
КБ
КБ
<
КБ
<
<
@Entity('groups')
export class Groups {
@PrimaryGeneratedColumn({ type: 'integer', name: 'id' })
id: number;
@Column({ type: 'int', nullable: true })
parentid: number | null;
@Column({ type: 'varchar', length: 1024 })
name: string;
@Column({ type: 'varchar', nullable: true, length: 4096 })
description?: string;
@ManyToOne(() => Groups, groups => groups.children)
@JoinColumn({ name: 'parentid' })
parent?: Groups
@OneToMany(() => Groups, groups => groups.parent)
@JoinColumn({ name: 'id' })
children: Groups[]<
КБ
<
DE
@OneToMany(() => DisciplineHoured, disciplineHoured => disciplineHoured.discipline)Каждая дисциплина с часами имеет одну дисциплину родителя
houredDisciplines: DisciplineHoured[]
@ManyToOne(() => Discipline, discipline => discipline.houredDisciplines)Я попытался сравнить на примере с Кафедрами и Институтом, на которые почему-то не ругается, но ведь разницы нет.
discipline: Discipline
@OneToMany(() => Cathedra, cathedra => cathedra.institute)
cathedras: Cathedra[];
@ManyToOne(() => Institute, institute => institute.cathedras)
institute: Institute