diff options
Diffstat (limited to 'db')
| -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 관련 수정 }; }) |
