251213:1509 Docunment Number Businee Rule not correct
This commit is contained in:
@@ -4,7 +4,7 @@ import { ShopDrawingRevision } from '../../drawing/entities/shop-drawing-revisio
|
||||
|
||||
@Entity('rfa_items')
|
||||
export class RfaItem {
|
||||
@PrimaryColumn({ name: 'rfarev_correspondence_id' })
|
||||
@PrimaryColumn({ name: 'rfa_revision_id' })
|
||||
rfaRevisionId!: number;
|
||||
|
||||
@PrimaryColumn({ name: 'shop_drawing_revision_id' })
|
||||
@@ -14,11 +14,7 @@ export class RfaItem {
|
||||
@ManyToOne(() => RfaRevision, (rfaRev) => rfaRev.items, {
|
||||
onDelete: 'CASCADE',
|
||||
})
|
||||
@JoinColumn({ name: 'rfarev_correspondence_id' }) // Link to correspondence_id of the revision (as per SQL schema) OR id
|
||||
// Note: ตาม SQL Schema "rfarev_correspondence_id" FK ไปที่ correspondence_revisions(correspondence_id)
|
||||
// แต่เพื่อให้ TypeORM ใช้ง่าย ปกติเราจะ Link ไปที่ PK ของ RfaRevision
|
||||
// **แต่** ตาม SQL: FOREIGN KEY (rfarev_correspondence_id) REFERENCES correspondences(id)
|
||||
// ดังนั้นต้องระวังจุดนี้ ใน Service เราจะใช้ correspondenceId เป็น Key
|
||||
@JoinColumn({ name: 'rfa_revision_id' })
|
||||
rfaRevision!: RfaRevision;
|
||||
|
||||
@ManyToOne(() => ShopDrawingRevision)
|
||||
|
||||
Reference in New Issue
Block a user