migrations

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Exporter

type Exporter struct {
	// contains filtered or unexported fields
}

func NewExporter

func NewExporter(
	name string,
	pager *common.Pager,
	templateName string,
	ddlBuilder *sql.DDLBuilderManager,
	maker MigrationMaker,
) *Exporter

func (*Exporter) Export

func (e *Exporter) Export(
	ctx context.Context,
	params *exporter.ExportParams,
) ([]*exporter.ExportedPage, error)

func (*Exporter) ExportPerFile

func (e *Exporter) ExportPerFile(
	ctx context.Context,
	params *exporter.ExportParams,
) ([]*exporter.ExportedPage, error)

type FuncMigrationMaker

type FuncMigrationMaker struct {
	// contains filtered or unexported fields
}

func (*FuncMigrationMaker) MakeMultiple

func (m *FuncMigrationMaker) MakeMultiple() *MigrationMeta

func (*FuncMigrationMaker) MakeSingle

func (m *FuncMigrationMaker) MakeSingle(index int, tableName gds.String) *MigrationMeta

type MakeMultipleMigrationFunc

type MakeMultipleMigrationFunc func() *MigrationMeta

type MakeSingleMigrationFunc

type MakeSingleMigrationFunc func(index int, tableName gds.String) *MigrationMeta

type Migration

type Migration struct {
	Meta map[string]interface{}

	UpQueries   []string
	DownQueries []string
}

type MigrationMaker

type MigrationMaker interface {
	MakeSingle(index int, tableName gds.String) *MigrationMeta
	MakeMultiple() *MigrationMeta
}

type MigrationMeta

type MigrationMeta struct {
	Filename string
	Attrs    map[string]interface{}
}

type Specification added in v0.5.7

type Specification struct {
	Use struct {
		IfNotExists bool `yaml:"if_not_exists" json:"if_not_exists"`
		IfExists    bool `yaml:"if_exists" json:"if_exists"`
	} `yaml:"use"`
	Target schema.DatabaseDriver `yaml:"target" json:"target"`
}

func (*Specification) InjectDatabaseDriver added in v0.5.7

func (m *Specification) InjectDatabaseDriver(driver schema.DatabaseDriver)

func (*Specification) Validate added in v0.5.7

func (m *Specification) Validate() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL