feat: per-type settings tabs and the SEO tab permission
This commit is contained in:
31
updates/202610270004_create_golem15_seo_type_settings.go
Normal file
31
updates/202610270004_create_golem15_seo_type_settings.go
Normal 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...)
|
||||
}
|
||||
Reference in New Issue
Block a user