- Register golem15.journal requiring exactly golem15.translate - Squash golem15_journal_posts DDL with unique slug and JSONB columns - Persist one en/pl Post through translate helpers on real Postgres Co-authored-by: Cursor <cursoragent@cursor.com>
44 lines
1017 B
Go
44 lines
1017 B
Go
package journal
|
|
|
|
import (
|
|
"git.golem15.com/golem15/sm-journal-plugin/models"
|
|
"git.golem15.com/golem15/sm-journal-plugin/updates"
|
|
"git.golem15.com/golem15/summercms/modules/backpack"
|
|
"git.golem15.com/golem15/summercms/modules/pact"
|
|
"git.golem15.com/golem15/summercms/modules/party"
|
|
"github.com/go-gormigrate/gormigrate/v2"
|
|
)
|
|
|
|
var (
|
|
_ party.Plugin = (*Plugin)(nil)
|
|
_ pact.HasMigrations = (*Plugin)(nil)
|
|
_ pact.HasModels = (*Plugin)(nil)
|
|
)
|
|
|
|
// Plugin is the golem15.journal plugin.
|
|
type Plugin struct {
|
|
app *backpack.App
|
|
}
|
|
|
|
func (p *Plugin) ID() string { return "golem15.journal" }
|
|
|
|
func (p *Plugin) Requires() []string { return []string{"golem15.translate"} }
|
|
|
|
func (p *Plugin) Register(app *backpack.App) error {
|
|
p.app = app
|
|
return nil
|
|
}
|
|
|
|
func (p *Plugin) Boot(app *backpack.App) error {
|
|
p.app = app
|
|
return nil
|
|
}
|
|
|
|
func (p *Plugin) Migrations() []*gormigrate.Migration { return updates.All() }
|
|
|
|
func (p *Plugin) Models() []any { return models.All() }
|
|
|
|
func init() {
|
|
party.Register(&Plugin{})
|
|
}
|