feat: migration 0020 group_key + move state-of-padel to reports/

- Migration 0020: add group_key TEXT column + index to articles table
- DELETE state-of-padel rows from articles (slug collision, moving to reports)
- git mv state-of-padel-q1-2026-{en,de}.md → data/content/reports/

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Deeman
2026-02-27 07:35:50 +01:00
parent 834f9cb702
commit 250139598c
3 changed files with 24 additions and 0 deletions

View File

@@ -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%'")