Copy-first script
Finn manglende content_tags-koblinger
Kontrollspørring som finner innhold uten tag-kobling.
Forutsetninger
MySQL 8.0+, MySQL Workbench.
Finn manglende content_tags-koblinger
Kontrollspørring som finner innhold uten tag-kobling.
Kode
SELECT 'tutorial' AS content_type, t.tutorial_id AS item_id, t.title
FROM tutorials t
LEFT JOIN content_tags ct ON ct.content_type = 'tutorial' AND ct.item_id = t.tutorial_id
WHERE ct.item_id IS NULL;
Bruk
Scriptet er laget for copy-first arbeidsflyt. Kjør det først i et testmiljø eller mot en kopi av relevante tabeller.
Klar til bruk
Kodevindu
Koden er optimalisert for rask kopiering og videre tilpasning i eget prosjekt.
SELECT 'tutorial' AS content_type, t.tutorial_id AS item_id, t.title
FROM tutorials t
LEFT JOIN content_tags ct ON ct.content_type = 'tutorial' AND ct.item_id = t.tutorial_id
WHERE ct.item_id IS NULL;