ekzyis b54268a88f
normalized wallet logs (#1826)
* Add invoiceId, withdrawalId to wallet logs

* Truncate wallet logs

* Fix extra db dips per log line

* Fix leak of invoice for sender
2025-03-22 17:31:10 -05:00

9 lines
462 B
SQL

ALTER TABLE "WalletLog"
ADD COLUMN "invoiceId" INTEGER,
ADD COLUMN "withdrawalId" INTEGER;
ALTER TABLE "WalletLog" ADD CONSTRAINT "WalletLog_invoiceId_fkey" FOREIGN KEY ("invoiceId") REFERENCES "Invoice"("id") ON DELETE SET NULL ON UPDATE CASCADE;
ALTER TABLE "WalletLog" ADD CONSTRAINT "WalletLog_withdrawalId_fkey" FOREIGN KEY ("withdrawalId") REFERENCES "Withdrawl"("id") ON DELETE SET NULL ON UPDATE CASCADE;
TRUNCATE "WalletLog" RESTRICT;