Delete columns CustomerEmail, OrderId, ItemCode (#6170)

This commit is contained in:
Nicolas Dorier
2024-08-27 09:53:28 +09:00
committed by GitHub
parent 6d560caf06
commit 3c40dc1f49
12 changed files with 94 additions and 44 deletions

View File

@@ -0,0 +1,12 @@
CREATE OR REPLACE FUNCTION get_orderid(invoice_blob jsonb)
RETURNS text AS $$
SELECT invoice_blob->'metadata'->>'orderId';
$$ LANGUAGE sql IMMUTABLE;
CREATE OR REPLACE FUNCTION get_itemcode(invoice_blob jsonb)
RETURNS text AS $$
SELECT invoice_blob->'metadata'->>'itemCode';
$$ LANGUAGE sql IMMUTABLE;
CREATE INDEX IF NOT EXISTS "IX_Invoices_Metadata_OrderId" ON "Invoices" (get_orderid("Blob2")) WHERE get_orderid("Blob2") IS NOT NULL;
CREATE INDEX IF NOT EXISTS "IX_Invoices_Metadata_ItemCode" ON "Invoices" (get_itemcode("Blob2")) WHERE get_itemcode("Blob2") IS NOT NULL;