mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 13:31:56 +00:00
feat(BE): implement expense tracking for stock transfers and enhance related services
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
DROP TABLE IF EXISTS daily_checklist_tasks;
|
||||
-- Drop tables in correct order (child tables before parent tables)
|
||||
DROP TABLE IF EXISTS daily_checklist_activity_task_assignments; -- Child table with FK to daily_checklist_activity_tasks
|
||||
DROP TABLE IF EXISTS daily_checklist_activity_task_assignees;
|
||||
DROP TABLE IF EXISTS daily_checklist_activity_tasks;
|
||||
DROP TABLE IF EXISTS daily_checklist_tasks;
|
||||
DROP TABLE IF EXISTS daily_checklist_phases;
|
||||
DROP TABLE IF EXISTS daily_checklists;
|
||||
DROP TABLE IF EXISTS checklists;
|
||||
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
-- Remove expense_nonstock_id from stock_transfer_details
|
||||
ALTER TABLE stock_transfer_details DROP CONSTRAINT IF EXISTS fk_stock_transfer_details_expense_nonstock;
|
||||
ALTER TABLE stock_transfer_details DROP COLUMN IF EXISTS expense_nonstock_id;
|
||||
DROP INDEX IF EXISTS idx_stock_transfer_details_expense_nonstock_id;
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
-- Add expense_nonstock_id to stock_transfer_details
|
||||
-- This allows tracking expedition/transport costs for stock transfers (same as purchase)
|
||||
|
||||
ALTER TABLE stock_transfer_details
|
||||
ADD COLUMN expense_nonstock_id BIGINT,
|
||||
ADD CONSTRAINT fk_stock_transfer_details_expense_nonstock
|
||||
FOREIGN KEY (expense_nonstock_id) REFERENCES expense_nonstocks(id) ON DELETE SET NULL;
|
||||
|
||||
-- Create index for better query performance
|
||||
CREATE INDEX idx_stock_transfer_details_expense_nonstock_id ON stock_transfer_details(expense_nonstock_id);
|
||||
Reference in New Issue
Block a user