migration

package
v1.16.3 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2025 License: MIT Imports: 15 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ChangePatterns = []string{
	`_(to|from|in)_(\w+)_table$`,
	`_(to|from|in)_(\w+)$`,
}
View Source
var CreatePatterns = []string{
	`^create_(\w+)_table$`,
	`^create_(\w+)$`,
}

Functions

This section is empty.

Types

type Creator added in v1.15.12

type Creator struct {
}

func NewCreator added in v1.15.12

func NewCreator() *Creator

func (*Creator) GetFileName added in v1.15.12

func (r *Creator) GetFileName(name string) string

GetFileName Get the full path to the migration.

func (*Creator) GetPath added in v1.15.12

func (r *Creator) GetPath(name string) string

GetPath Get the full path to the migration.

func (*Creator) GetStub added in v1.15.12

func (r *Creator) GetStub(table string, create bool) string

GetStub Get the migration stub file.

func (*Creator) PopulateStub added in v1.15.12

func (r *Creator) PopulateStub(stub, signature, table string) string

PopulateStub Populate the place-holders in the migration stub.

type Migrator added in v1.15.12

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

func NewMigrator added in v1.15.12

func NewMigrator(artisan console.Artisan, schema contractsschema.Schema, table string) *Migrator

func (*Migrator) Create added in v1.15.12

func (r *Migrator) Create(name string) (string, error)

func (*Migrator) Fresh added in v1.15.12

func (r *Migrator) Fresh() error

func (*Migrator) Reset added in v1.15.12

func (r *Migrator) Reset() error

func (*Migrator) Rollback added in v1.15.12

func (r *Migrator) Rollback(step, batch int) error

func (*Migrator) Run added in v1.15.12

func (r *Migrator) Run() error

func (*Migrator) Status added in v1.15.12

func (r *Migrator) Status() ([]contractsmigration.Status, error)

type Repository

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

func NewRepository

func NewRepository(schema schema.Schema, table string) *Repository

func (*Repository) CreateRepository

func (r *Repository) CreateRepository() error

func (*Repository) Delete

func (r *Repository) Delete(migration string) error

func (*Repository) DeleteRepository

func (r *Repository) DeleteRepository() error

func (*Repository) GetLast

func (r *Repository) GetLast() ([]migration.File, error)

func (*Repository) GetLastBatchNumber added in v1.15.12

func (r *Repository) GetLastBatchNumber() (int, error)

func (*Repository) GetMigrations

func (r *Repository) GetMigrations() ([]migration.File, error)

func (*Repository) GetMigrationsByBatch

func (r *Repository) GetMigrationsByBatch(batch int) ([]migration.File, error)

func (*Repository) GetMigrationsByStep

func (r *Repository) GetMigrationsByStep(steps int) ([]migration.File, error)

func (*Repository) GetNextBatchNumber

func (r *Repository) GetNextBatchNumber() (int, error)

func (*Repository) GetRan

func (r *Repository) GetRan() ([]string, error)

func (*Repository) Log

func (r *Repository) Log(file string, batch int) error

func (*Repository) RepositoryExists

func (r *Repository) RepositoryExists() bool

type Stubs

type Stubs struct {
}

func (Stubs) Create

func (receiver Stubs) Create() string

func (Stubs) Empty

func (receiver Stubs) Empty() string

func (Stubs) Update

func (receiver Stubs) Update() string

type TableGuesser

type TableGuesser struct {
}

func (TableGuesser) Guess

func (receiver TableGuesser) Guess(migration string) (string, bool)

Guess Attempt to guess the table name and "creation" status of the given migration, return table, create.

Jump to

Keyboard shortcuts

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