Documentation
¶
Overview ¶
Package migrate provides migration command orchestration, migration file generation and collection automigration hooks.
Index ¶
Constants ¶
const TemplateLangGo = "go"
Variables ¶
var Descriptor = servicebase.Descriptor{ Name: "migrate", Purpose: "Provides migration command binding, migration file generation and collection automigration hooks.", Dependencies: []string{ "core.App", "cobra", "dbase migrations registry", }, RuntimeState: []string{ "cached collection snapshots in app store when automigrate is enabled", }, Operations: []string{ "Bind", "CreateCommand", "CreateMigration", "CreateCollectionsSnapshot", }, }
Functions ¶
func MustRegister ¶
MustRegister is a compatibility helper that binds the service to the root command and panics on error.
Types ¶
type Config ¶
type Config struct {
// Dir specifies the directory with the user defined migrations.
//
// If not set it defaults to a path relative to the app data directory.
Dir string
// Automigrate specifies whether to enable collection automigrations.
Automigrate bool
}
Config defines the migrate service options.
type Service ¶
type Service struct {
servicebase.Service
// contains filtered or unexported fields
}
Service provides migration command orchestration and automigrate hooks.
func (*Service) Bind ¶
Bind attaches the migrate command to the provided root command and wires automigrate hooks when enabled.
func (*Service) CreateCollectionsSnapshot ¶
CreateCollectionsSnapshot creates a snapshot migration for current collections.
func (*Service) CreateCommand ¶
CreateCommand builds the cobra migrate command bound to the service.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package apis is reserved for migrate service HTTP bindings.
|
Package apis is reserved for migrate service HTTP bindings. |
|
Package forms contains migrate command/request forms when migrate flows need validation-oriented DTOs.
|
Package forms contains migrate command/request forms when migrate flows need validation-oriented DTOs. |
|
Package migrations is intentionally empty for the migrate tooling service.
|
Package migrations is intentionally empty for the migrate tooling service. |
|
Package queries contains migrate service read-side helpers.
|
Package queries contains migrate service read-side helpers. |