Documentation
¶
Overview ¶
A very lightweigh migration tool to replace `ent.Schema.Create` calls.
Index ¶
- Constants
- Variables
- func NewLogger(log *slog.Logger) migrate.Logger
- func SetMigrationTableName(conn, tableName string) (string, error)
- func Up(conn string) error
- func WaitForMigrationJob(conn string, logger *slog.Logger, waitOpts ...WaitForMigrationOption) error
- type FS
- type Migrate
- type SourceWrapper
- type WaitForMigrationOption
Constants ¶
View Source
const IgnoreMarker = "-- migration:ignore"
View Source
const (
MigrationsTable = "schema_om"
)
Variables ¶
View Source
var ErrNoChange = migrate.ErrNoChange
View Source
var OMMigrations embed.FS
Functions ¶
func SetMigrationTableName ¶
func WaitForMigrationJob ¶
func WaitForMigrationJob(conn string, logger *slog.Logger, waitOpts ...WaitForMigrationOption) error
Types ¶
type Migrate ¶
type Migrate struct {
// contains filtered or unexported fields
}
func NewMigrate ¶
NewMigrate creates a new migrate instance.
func (*Migrate) LatestVersion ¶
type SourceWrapper ¶
type SourceWrapper struct {
// contains filtered or unexported fields
}
func NewSourceWrapper ¶
func NewSourceWrapper(fsys fs.FS) *SourceWrapper
type WaitForMigrationOption ¶
type WaitForMigrationOption func(*waitForMigrationOptions)
Click to show internal directories.
Click to hide internal directories.