Documentation
¶
Overview ¶
Package exporter provides functionality for exporting database migrations and schemas.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Format ExportFormat
Dialect plugins.Dialect
OutputDir string
AuthOnly bool
Plugins []plugins.Plugin // Plugin instances to export
}
Config configures the migration exporter.
type ExportFormat ¶
type ExportFormat string
ExportFormat defines the output format for migration exports.
const ( // FormatSQL exports migrations as plain SQL files. FormatSQL ExportFormat = "sql" // FormatGoose exports migrations in Goose format. FormatGoose ExportFormat = "goose" // FormatGolangMigrate exports migrations in golang-migrate format. FormatGolangMigrate ExportFormat = "golang-migrate" )
type Exporter ¶
type Exporter struct {
// contains filtered or unexported fields
}
Exporter handles exporting migrations to various formats.
func NewExporter ¶
NewExporter creates a new migration exporter with the provided configuration.
func (*Exporter) Export ¶
Export writes migrations to disk in the specified format.
Files are placed directly in OutputDir with sequentially-assigned numeric prefixes: auth migrations first, then plugin migrations in alphabetical plugin-name order.
Any file whose name contains "_aegis_" that already exists in OutputDir is removed before new files are written. This keeps the folder in sync with the current Aegis version without disturbing files the developer created themselves (which must not use "_aegis_" in their own filenames).