feat: per-type settings tabs and the SEO tab permission

This commit is contained in:
2026-10-27 10:36:32 +01:00
parent ce60c8a1ee
commit 30edb8adee
11 changed files with 560 additions and 6 deletions

View File

@@ -0,0 +1,31 @@
package updates
import (
"github.com/go-gormigrate/gormigrate/v2"
"gorm.io/gorm"
)
// createTypeSettings creates golem15_seo_type_settings: one row per content
// type key once an editor saves its settings tab (D-104). A type without a
// row uses the defaults: tab shown, general templates, D-21 robots.
var createTypeSettings = []*gormigrate.Migration{
{
ID: "202610270004_create_golem15_seo_type_settings",
Migrate: func(tx *gorm.DB) error {
return tx.Exec(`CREATE TABLE golem15_seo_type_settings (
type_key TEXT PRIMARY KEY,
inject BOOLEAN NOT NULL DEFAULT TRUE,
title_template TEXT NOT NULL DEFAULT '',
description_template TEXT NOT NULL DEFAULT '',
robots TEXT NOT NULL DEFAULT ''
)`).Error
},
Rollback: func(tx *gorm.DB) error {
return tx.Exec(`DROP TABLE IF EXISTS golem15_seo_type_settings`).Error
},
},
}
func init() {
Register(createTypeSettings...)
}