Link receipts to pending purchase approval
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 2m44s

This commit is contained in:
Cauê Faleiros
2026-08-27 11:28:34 -03:00
parent 458efa073d
commit e8a684b0ab
4 changed files with 71 additions and 25 deletions

View File

@@ -626,6 +626,11 @@ const initDB = async () => {
await pool.query(`CREATE INDEX IF NOT EXISTS idx_supply_purchase_orders_status ON supply_purchase_orders (status, created_at DESC);`);
await pool.query(`
ALTER TABLE supply_receipts
ADD COLUMN IF NOT EXISTS purchase_order_id INTEGER REFERENCES supply_purchase_orders(id) ON DELETE SET NULL;
`).catch(() => {});
await pool.query(`
ALTER TABLE production_orders
ADD COLUMN IF NOT EXISTS notes TEXT,