feat(17-04): menu:import-winter with the D-05 type map and read-only export SQL

- link to url, blog_categories to all-journal-categories, --map old=new on top; page entries dropped
- entries of unknown types or stale registry references dropped with their subtree, one report line per dropped or remapped entry
- ids, menu_id, parent_id, nest columns and sort_order kept; setval for both tables; --force, --dry-run, empty files copy nothing
- scripts/winter-export-menus.sql and winter-export-entries.sql
- TestMenuImportSmoke
This commit is contained in:
2026-10-12 17:35:30 +02:00
parent 08f99b8aad
commit e044bc7b7e
6 changed files with 857 additions and 2 deletions

View File

@@ -5,9 +5,11 @@
package menu
import (
"git.golem15.com/golem15/sm-menu-plugin/console"
"git.golem15.com/golem15/sm-menu-plugin/models"
"git.golem15.com/golem15/sm-menu-plugin/updates"
"git.golem15.com/golem15/summercms/modules/backpack"
"git.golem15.com/golem15/summercms/modules/bonfire"
"git.golem15.com/golem15/summercms/modules/pact"
"git.golem15.com/golem15/summercms/modules/party"
"github.com/go-gormigrate/gormigrate/v2"
@@ -17,6 +19,7 @@ var (
_ party.Plugin = (*Plugin)(nil)
_ pact.HasMigrations = (*Plugin)(nil)
_ pact.HasModels = (*Plugin)(nil)
_ pact.HasCommands = (*Plugin)(nil)
)
// Plugin is the golem15.menu plugin.
@@ -40,6 +43,11 @@ func (p *Plugin) Boot(app *backpack.App) error {
return nil
}
// Commands registers menu:import-winter.
func (p *Plugin) Commands() []bonfire.Command {
return []bonfire.Command{console.ImportWinter(p.app)}
}
func (p *Plugin) Migrations() []*gormigrate.Migration { return updates.All() }
func (p *Plugin) Models() []any { return models.All() }