Add support for gdpr_removal field on orders and set a timestamp for … (#377)

* Add support for gdpr_removal field on orders and set a timestamp for all orders with a comment containing the abbrevation GDPR

* Added gdpr removal field to v_funnel_orders view
This commit is contained in:
Olaf Lindström
2024-02-22 11:36:20 +01:00
committed by GitHub
parent 4448e8cc52
commit 97cd625f3d
2 changed files with 67 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
ALTER TABLE orders
ADD COLUMN IF NOT EXISTS gdpr_removal TIMESTAMP WITH TIME ZONE;
UPDATE orders
SET gdpr_removal = NOW()::timestamp
WHERE id IN (SELECT id FROM orders WHERE LOWER(comment::TEXT) LIKE '%gdpr%');