- In order to guarantee PO number uniqueness across all orders a unique constraint needs to be added for PO number filed in DB.
Right now the uniqueness is enforced by the validation that takes place when Order is created/update, but since there is a gap between validation and actual update of the Order it is not reliable and sufficient.
- Also it's expected that PO number will often be used for searching the Order, so indexing this field should improve the performance.
- Unique constraint is added for PO number field
- Index is created for PO number field