mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-03-12 19:02:01 +01:00
10 lines
348 B
MySQL
10 lines
348 B
MySQL
|
CREATE OR REPLACE FUNCTION is_pending(status TEXT)
|
||
|
RETURNS BOOLEAN AS $$
|
||
|
SELECT status = 'Processing' OR status = 'New';
|
||
|
$$ LANGUAGE sql IMMUTABLE;
|
||
|
|
||
|
CREATE INDEX "IX_Invoices_Pending" ON "Invoices"((1)) WHERE is_pending("Status");
|
||
|
CREATE INDEX "IX_Payments_Pending" ON "Payments"((1)) WHERE is_pending("Status");
|
||
|
|
||
|
DROP TABLE "PendingInvoices";
|