Merge pull request 'fix: refs #7722 delete sms' (!2732) from 7722-deleteSms into master
gitea/salix/pipeline/head This commit looks good Details

Reviewed-on: #2732
Reviewed-by: Carlos Andrés <carlosap@verdnatura.es>
This commit is contained in:
Robert Ferrús 2024-07-16 07:04:57 +00:00
commit b1fa47b74c
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;