Details
-
Story
-
Status: Closed (View Workflow)
-
P3
-
Resolution: Done
-
None
-
None
-
-
ACQ Sprint 64
-
3
-
EBSCO - FSE
Description
Purpose
- An order line can be created only if corresponding order exists so the foreign key (FK) should be created. Also a piece record can be created only if order line exists.
Approach
Define foreign keys
"tables": [ ... { "tableName": "purchase_order", "fromModuleVersion": 1.0, "withMetadata": true, "populateJsonWithId": true, "customSnippetPath": "purchase_order_table.sql", "ginIndex": [ { "fieldName": "poNumber", "caseSensitive": false, "removeAccents": true } ], "uniqueIndex": [ { "fieldName": "poNumber" } ] }, { "tableName": "po_line", "fromModuleVersion": 1.0, "withMetadata": true, "populateJsonWithId": true, "foreignKeys": [ { "fieldName": "purchaseOrderId", "targetTable": "purchase_order" } ], "ginIndex": [ { "fieldName": "title", "caseSensitive": false, "removeAccents": true } ], "uniqueIndex": [ { "fieldName": "poLineNumber" } ] }, { "tableName": "pieces", "fromModuleVersion": 1.0, "withMetadata": true, "populateJsonWithId": true, "foreignKeys": [ { "fieldName": "poLineId", "targetTable": "po_line" } ] } ]
Note: pieces table definition should be moved after po_line due to FK
Scope:
Introduction of the foreign keys will also prevent records deletion if they are referenced by other entities i.e.
- PO cannot be deleted if there is at least one PO Line
- PO Line cannot be deleted if there is at least one piece record
References
TestRail: Results
Attachments
Issue Links
- has to be done before
-
MODINVOSTO-19 Remove associated invoice-lines when removing an invoice
-
- Closed
-
- relates to
-
UIOR-27 Reorganize the search and filter pane on the Orders landing page
-
- Closed
-
-
UXPROD-1606 Ordering quality assurance enhancements - Round 1
-
- Closed
-
-
MODORDSTOR-79 Remove associated piece records when removing POLine
-
- Closed
-
-
MODORDSTOR-85 DB Optimization
-
- Closed
-