feat: add join columns

This commit is contained in:
2026-11-02 14:51:55 +03:30
parent a0801be463
commit 71ce020803
19 changed files with 387 additions and 77 deletions
@@ -3,6 +3,7 @@ import {
BaseEntity,
Column,
Entity,
JoinColumn,
ManyToOne,
PrimaryGeneratedColumn,
} from 'typeorm';
@@ -12,9 +13,17 @@ export class ResultRange extends BaseEntity {
@PrimaryGeneratedColumn()
id!: number;
@Column({
type: 'int',
name: 'testId',
nullable: false,
})
testId!: number;
@ManyToOne(() => Test, (test) => test.resultRanges, {
onDelete: 'CASCADE',
})
@JoinColumn({ name: 'testId' })
test!: Test;
@Column({