entity 연결 수정 및 코드정리
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { BaseModel } from 'src/common/entities/base.entity';
|
||||
import { FarmModel } from 'src/farm/entities/farm.entity';
|
||||
import { CowModel } from 'src/cow/entities/cow.entity';
|
||||
import {
|
||||
Column,
|
||||
Entity,
|
||||
@@ -254,7 +254,10 @@ export class MptModel extends BaseModel {
|
||||
creatine: number;
|
||||
|
||||
// Relations
|
||||
@ManyToOne(() => FarmModel, { onDelete: 'CASCADE' })
|
||||
@JoinColumn({ name: 'fk_farm_no' })
|
||||
farm: FarmModel;
|
||||
@ManyToOne(() => CowModel, {
|
||||
onDelete: 'CASCADE',
|
||||
createForeignKeyConstraints: false
|
||||
})
|
||||
@JoinColumn({ name: 'cow_id', referencedColumnName: 'cowId' })
|
||||
cow: CowModel;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user