migrate

package
v1.0.0-beta.210 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

A very lightweigh migration tool to replace `ent.Schema.Create` calls.

Index

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 SetMigrationTableName(conn, tableName string) (string, error)

func Up

func Up(conn string) error

Types

type FS

type FS interface {
	fs.ReadDirFS
	fs.ReadFileFS
}

type Migrate

type Migrate = migrate.Migrate

func NewMigrate

func NewMigrate(conn string, fs fs.FS, fsPath string) (*Migrate, error)

NewMigrate creates a new migrate instance.

type SourceWrapper

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

func NewSourceWrapper

func NewSourceWrapper(fsys fs.FS) *SourceWrapper

func (*SourceWrapper) Open

func (s *SourceWrapper) Open(name string) (fs.File, error)

func (*SourceWrapper) ReadDir

func (s *SourceWrapper) ReadDir(path string) ([]fs.DirEntry, error)

func (*SourceWrapper) ReadFile

func (s *SourceWrapper) ReadFile(name string) ([]byte, error)

Jump to

Keyboard shortcuts

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