-- AlterTable
ALTER TABLE "shortfall_analytics_daily" ADD COLUMN IF NOT EXISTS "unlinkedActualQty" DECIMAL(65,30) DEFAULT 0,
ADD COLUMN IF NOT EXISTS "unlinkedActualAmount" DECIMAL(65,30) DEFAULT 0,
ADD COLUMN IF NOT EXISTS "totalActualQty" DECIMAL(65,30) DEFAULT 0,
ADD COLUMN IF NOT EXISTS "totalActualAmount" DECIMAL(65,30) DEFAULT 0,
ADD COLUMN IF NOT EXISTS "totalPlannedQty" DECIMAL(65,30) DEFAULT 0,
ADD COLUMN IF NOT EXISTS "totalPlannedAmount" DECIMAL(65,30) DEFAULT 0;

-- CreateIndex
CREATE INDEX IF NOT EXISTS "shortfall_analytics_daily_date_idx" ON "shortfall_analytics_daily"("date");

-- CreateIndex
CREATE INDEX IF NOT EXISTS "shortfall_analytics_daily_date_branchKey_idx" ON "shortfall_analytics_daily"("date", "branchKey");

-- CreateIndex
CREATE INDEX IF NOT EXISTS "shortfall_analytics_daily_date_unitId_idx" ON "shortfall_analytics_daily"("date", "unitId");

-- CreateIndex
CREATE INDEX IF NOT EXISTS "invoices_docDt_idx" ON "invoices"("docDt");

-- CreateIndex
CREATE INDEX IF NOT EXISTS "invoices_docDt_branchId_idx" ON "invoices"("docDt", "branchId");

-- CreateIndex
CREATE INDEX IF NOT EXISTS "invoices_docDt_unitId_idx" ON "invoices"("docDt", "unitId");

-- CreateIndex
CREATE INDEX IF NOT EXISTS "invoice_line_items_invoiceId_idx" ON "invoice_line_items"("invoiceId");

