diff --git a/data/content/articles/state-of-padel-q1-2026-de.md b/data/content/reports/state-of-padel-q1-2026-de.md similarity index 100% rename from data/content/articles/state-of-padel-q1-2026-de.md rename to data/content/reports/state-of-padel-q1-2026-de.md diff --git a/data/content/articles/state-of-padel-q1-2026-en.md b/data/content/reports/state-of-padel-q1-2026-en.md similarity index 100% rename from data/content/articles/state-of-padel-q1-2026-en.md rename to data/content/reports/state-of-padel-q1-2026-en.md diff --git a/web/src/padelnomics/migrations/versions/0020_articles_group_key.py b/web/src/padelnomics/migrations/versions/0020_articles_group_key.py new file mode 100644 index 0000000..dfa2bfb --- /dev/null +++ b/web/src/padelnomics/migrations/versions/0020_articles_group_key.py @@ -0,0 +1,24 @@ +"""Add group_key column to articles for cross-language static article grouping. + +Static cornerstone articles (e.g. padel-hall-cost-guide EN vs padel-halle-kosten DE) +have different url_paths per language, so they cannot be grouped by url_path alone. +The group_key (populated from the `cornerstone` frontmatter field, e.g. 'C2') is a +shared key that pairs EN/DE variants of the same static article. + +pSEO articles leave group_key NULL and continue to group by url_path (unchanged). + +Also removes any state-of-padel articles that are being moved to the reports flow. +""" + + +def up(conn): + conn.execute( + "ALTER TABLE articles ADD COLUMN group_key TEXT DEFAULT NULL" + ) + conn.execute( + "CREATE INDEX IF NOT EXISTS idx_articles_group_key" + " ON articles(group_key)" + ) + # Remove state-of-padel rows — these are moving to the reports flow + # and would cause slug collisions (both EN/DE use slug 'state-of-padel-q1-2026') + conn.execute("DELETE FROM articles WHERE slug LIKE 'state-of-padel%'")