feat: entry generation job and cleanup on delete

This commit is contained in:
2026-10-27 10:48:02 +01:00
parent e8a6b9fc77
commit ab8905c429
10 changed files with 529 additions and 4 deletions

View File

@@ -115,7 +115,9 @@ func TestResolverPrecedence(t *testing.T) {
env.createPage(t, token, map[string]any{"title": "Bare", "slug": "bare", "published": true})
env.createPage(t, token, map[string]any{"title": "Draft", "slug": "draft", "excerpt": "Secret", "published": false})
if err := env.db.Exec(`INSERT INTO golem15_seo_entries (model_type, record_id, locale, type_key, title, description, canonical, robots, og_image, created_at, updated_at)
VALUES (?, ?, 'en', ?, 'Custom SEO title', 'Custom SEO description', '/canonical-custom', 'noindex', '/media/custom.png', NOW(), NOW())`, pagesModel, custom, pagesTypeKey).Error; err != nil {
VALUES (?, ?, 'en', ?, 'Custom SEO title', 'Custom SEO description', '/canonical-custom', 'noindex', '/media/custom.png', NOW(), NOW())
ON CONFLICT (model_type, record_id, locale) DO UPDATE SET title = EXCLUDED.title, description = EXCLUDED.description,
canonical = EXCLUDED.canonical, robots = EXCLUDED.robots, og_image = EXCLUDED.og_image`, pagesModel, custom, pagesTypeKey).Error; err != nil {
t.Fatal(err)
}
for _, rule := range []map[string]any{