fix: refs #7722 delete sms
gitea/salix/pipeline/pr-master This commit looks good Details

This commit is contained in:
Robert Ferrús 2024-07-15 12:02:00 +02:00
parent 67b19ee4ca
commit 200a6714bb
2 changed files with 7 additions and 0 deletions

View File

@ -28,6 +28,10 @@ BEGIN
DELETE FROM ticketDown WHERE created < util.yesterday();
DELETE FROM entryLog WHERE creationDate < v2Months;
DELETE IGNORE FROM expedition WHERE created < v26Months;
DELETE cs.*
FROM sms s
JOIN clientSms cs ON cs.smsFk = s.id
WHERE s. created < v18Months;
DELETE FROM sms WHERE created < v18Months;
DELETE FROM saleTracking WHERE created < v1Years;
DELETE FROM productionError WHERE dated < v1Years;

View File

@ -0,0 +1,3 @@
-- Place your SQL code here
ALTER TABLE vn.ticketSms__ DROP FOREIGN KEY IF EXISTS ticketSms_FK;
ALTER TABLE vn.ticketSms__ ADD CONSTRAINT ticketSms_FK FOREIGN KEY (smsFk) REFERENCES vn.sms(id) ON DELETE CASCADE ON UPDATE CASCADE;