diff options
| author | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-04-29 08:46:54 +0000 |
|---|---|---|
| committer | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-04-29 08:46:54 +0000 |
| commit | 22aaa33ec1d50948517fe7ca89b6486856708f0f (patch) | |
| tree | a717e9f3705afb3402278de40783d8dbd122e648 /db/schema/vendorData.ts | |
| parent | 0174e04cf0fd7b41292b3ee4961c4f952c267b4f (diff) | |
0429 DB 마이그레이션 오류 수정(vendor_data 스키마 수정)
Diffstat (limited to 'db/schema/vendorData.ts')
| -rw-r--r-- | db/schema/vendorData.ts | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/db/schema/vendorData.ts b/db/schema/vendorData.ts index ea6180ea..01608df4 100644 --- a/db/schema/vendorData.ts +++ b/db/schema/vendorData.ts @@ -130,6 +130,11 @@ export const tagSubfields = pgTable("tag_subfields", { table.tagTypeCode, table.attributesId ), + // attributesId와 projectId 조합 내에서 유니크(0429 db push 관련 수정) + uniqAttributeIdProject: unique("uniq_attribute_id_project").on( + table.attributesId, + table.projectId + ), // tagTypes 참조를 위한 복합 FK (tagTypeCode, projectId) // tagTypeRef: foreignKey({ // columns: [table.tagTypeCode, table.projectId], @@ -159,11 +164,12 @@ export const tagSubfieldOptions = pgTable("tag_subfield_options", { ), // tagSubfields 참조를 위한 복합 FK // attributesId만으로는 더 이상 유니크하지 않으므로 projectId도 함께 참조 - attributesRef: foreignKey({ - columns: [table.attributesId, table.projectId], - // tagSubfields의 attributesId + projectId 참조 - foreignColumns: [tagSubfields.attributesId, tagSubfields.projectId] - }).onDelete("cascade") + // attributesRef: foreignKey({ + // columns: [table.attributesId, table.projectId], + // // tagSubfields의 attributesId + projectId 참조 + // foreignColumns: [tagSubfields.attributesId, tagSubfields.projectId] + // }).onDelete("cascade") + // 0429 db push 관련 수정 }; }) |
