-- ============================================================
-- Money+Xfer -- Correction des liens de notifications obsoletes
-- Les notifications creees avant le renommage du dossier
-- "akuxfer" -> "moneyxfer" ont leur lien fige dans la base
-- (colonne link) avec l'ancien chemin. Ce script les corrige.
-- A executer une seule fois. Sans effet si aucune ligne concernee.
-- ============================================================

USE akuxfer;

-- Back-office (table notifications)
UPDATE notifications
SET link = REPLACE(link, '/akuxfer/public', '/moneyxfer/public')
WHERE link LIKE '%/akuxfer/public%';

-- Portail client (table client_notifications)
UPDATE client_notifications
SET link = REPLACE(link, '/akuxfer/public', '/moneyxfer/public')
WHERE link LIKE '%/akuxfer/public%';

-- Verification
SELECT id, title, link FROM notifications WHERE link LIKE '%akuxfer%';
SELECT id, title, link FROM client_notifications WHERE link LIKE '%akuxfer%';
