INSERT INTO redirects (source_path, target_url, status_code, is_active, note, created_at, updated_at)
SELECT mapping.source_path, mapping.target_url, 301, 1, mapping.note, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP
FROM (
    SELECT '/nos-logiciels/wintracabilite' AS source_path, '/modules/win-tracabilite/' AS target_url, 'Redirection ancien sitemap WININFO' AS note
    UNION ALL SELECT '/plan-du-site', '/sitemap.xml', 'Redirection ancien sitemap WININFO'
    UNION ALL SELECT '/nos-realisations', '/pages/developpement-sur-mesure/', 'Redirection ancien sitemap WININFO'
    UNION ALL SELECT '/mentions-legales', '/pages/mentions-legales/', 'Redirection ancien sitemap WININFO'
    UNION ALL SELECT '/nos-logiciels/wintransport', '/modules/win-transport/', 'Redirection ancien sitemap WININFO'
    UNION ALL SELECT '/article-iframe', '/', 'Redirection ancien sitemap WININFO'
    UNION ALL SELECT '/nos-partenaires', '/', 'Redirection ancien sitemap WININFO'
    UNION ALL SELECT '/assistance', '/pages/hotline/', 'Redirection ancien sitemap WININFO'
    UNION ALL SELECT '/acces-contact', '/pages/contact/', 'Redirection ancien sitemap WININFO'
    UNION ALL SELECT '/nos-logiciels', '/pages/solutions/', 'Redirection ancien sitemap WININFO'
    UNION ALL SELECT '/developpement-sur-mesure', '/pages/developpement-sur-mesure/', 'Redirection ancien sitemap WININFO'
    UNION ALL SELECT '/wintp', '/modules/win-tp/', 'Redirection ancien sitemap WININFO'
    UNION ALL SELECT '/wintransport', '/modules/win-transport/', 'Redirection ancien sitemap WININFO'
    UNION ALL SELECT '/winlogistique', '/modules/win-logistique/', 'Redirection ancien sitemap WININFO'
    UNION ALL SELECT '/wintablette', '/modules/win-tablette/', 'Redirection ancien sitemap WININFO'
    UNION ALL SELECT '/nos-formations-copy', '/pages/cfi/', 'Redirection ancien sitemap WININFO'
    UNION ALL SELECT '/reglement-interieur', '/pages/cfi/', 'Redirection ancien sitemap WININFO'
    UNION ALL SELECT '/conditions-generales-de-formation-janvier-2022', '/pages/conditions-generales-de-formation-janvier-2022/', 'Redirection ancien sitemap WININFO'
    UNION ALL SELECT '/formations', '/pages/cfi/', 'Redirection ancien sitemap WININFO'
    UNION ALL SELECT '/accueil_cfi', '/pages/cfi/', 'Redirection ancien sitemap WININFO'
    UNION ALL SELECT '/winwms', '/solutions/win-wms/', 'Redirection ancien sitemap WININFO'
    UNION ALL SELECT '/nos-formations', '/pages/cfi/', 'Redirection ancien sitemap WININFO'
    UNION ALL SELECT '/nos-actualites', '/blog/news/', 'Redirection ancien sitemap WININFO'
    UNION ALL SELECT '/le-transport-et-la-rgpd', '/pages/politique-de-confidentialite/', 'Redirection ancien sitemap WININFO'
    UNION ALL SELECT '/wininfo-conception-internet', '/pages/developpement-sur-mesure/', 'Redirection ancien sitemap WININFO'
    UNION ALL SELECT '/nouveau-logiciel-de-gestion-dentrepot', '/solutions/win-wms/', 'Redirection ancien sitemap WININFO'
    UNION ALL SELECT '/plan-de-maitrise-sanitaire', '/modules/win-tracabilite/', 'Redirection ancien sitemap WININFO'
    UNION ALL SELECT '/wininfo-editeur-cabinet-de-developpements-logiciels', '/pages/developpement-sur-mesure/', 'Redirection ancien sitemap WININFO'
    UNION ALL SELECT '/salon-du-fromage-2020', '/blog/news/', 'Redirection ancien sitemap WININFO'
    UNION ALL SELECT '/information-importante', '/blog/news/', 'Redirection ancien sitemap WININFO'
    UNION ALL SELECT '/wininfo-recrute', '/pages/contact/', 'Redirection ancien sitemap WININFO'
    UNION ALL SELECT '/parrainage', '/blog/news/offre-parrainage-wininfo/', 'Redirection ancien sitemap WININFO'
    UNION ALL SELECT '/wininfo-accueille-la-torche-des-jeux-de-paris-2024', '/blog/news/wininfo-accueille-la-torche-des-jeux-de-paris-2024/', 'Redirection ancien sitemap WININFO'
    UNION ALL SELECT '/category/erp', '/solutions/win-erp/', 'Redirection ancien sitemap WININFO'
    UNION ALL SELECT '/category/non-classe', '/blog/news/', 'Redirection ancien sitemap WININFO'
) AS mapping
LEFT JOIN redirects existing ON existing.source_path = mapping.source_path
WHERE existing.id IS NULL;
