migrate

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package migrate generates, writes, and applies database migrations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Root          string
	MigrationsDir string
	SnapshotPath  string
	SchemaName    string
	Dialect       dialect.Dialect
	Inspector     schema.Inspector
}

type Result

type Result struct {
	MigrationName string
	UpSQL         []string
	DownSQL       []string
	Diff          *schema.Diff
	Snapshot      *schema.Snapshot
}

type Service

type Service struct {
	Config Config
}

func NewService

func NewService(cfg Config) *Service

func (*Service) Generate

func (s *Service) Generate(ctx context.Context) (*Result, error)

func (*Service) Revert

func (s *Service) Revert(ctx context.Context, db *sql.DB, name string) error

func (*Service) Run

func (s *Service) Run(ctx context.Context, db *sql.DB) error

func (*Service) Status

func (s *Service) Status() ([]string, error)

func (*Service) Write

func (s *Service) Write(result *Result) error

Jump to

Keyboard shortcuts

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