Files
database/migrations/000.459.sql
T
Olaf LindströmandGitHub 97cd625f3d 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
2024-02-22 11:36:20 +01:00

6 lines
223 B
SQL

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%');