Documentation ¶
Index ¶
- type Command
- type Migration
- type MigrationFunc
- type Migrations
- func (m *Migrations) CreateGo(ctx context.Context, db *bun.DB, name string) error
- func (m *Migrations) CreateSQL(ctx context.Context, db *bun.DB, name string) error
- func (m *Migrations) Discover(fsys fs.FS) error
- func (m *Migrations) DiscoverCaller() error
- func (m *Migrations) Init(ctx context.Context, db *bun.DB) error
- func (m *Migrations) Lock(ctx context.Context, db *bun.DB) error
- func (m *Migrations) MarkCompleted(ctx context.Context, db *bun.DB) error
- func (m *Migrations) Migrate(ctx context.Context, db *bun.DB) error
- func (m *Migrations) Migrations() []Migration
- func (m *Migrations) MustRegister(up, down MigrationFunc)
- func (m *Migrations) Register(up, down MigrationFunc) error
- func (m *Migrations) Rollback(ctx context.Context, db *bun.DB) error
- func (m *Migrations) Status(ctx context.Context, db *bun.DB) error
- func (m *Migrations) Unlock(ctx context.Context, db *bun.DB) error
- type MigrationsOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Migration ¶
type Migration struct { bun.BaseModel `bun:"alias:m"` ID int64 Name string GroupID int64 MigratedAt time.Time `bun:",notnull,nullzero,default:current_timestamp"` Up MigrationFunc `bun:"-"` Down MigrationFunc `bun:"-"` }
type MigrationFunc ¶
func NewSQLMigrationFunc ¶
func NewSQLMigrationFunc(fsys fs.FS, name string) MigrationFunc
type Migrations ¶
type Migrations struct {
// contains filtered or unexported fields
}
func NewMigrations ¶
func NewMigrations(opts ...MigrationsOption) *Migrations
func (*Migrations) DiscoverCaller ¶
func (m *Migrations) DiscoverCaller() error
func (*Migrations) MarkCompleted ¶ added in v0.1.8
func (*Migrations) Migrations ¶
func (m *Migrations) Migrations() []Migration
func (*Migrations) MustRegister ¶
func (m *Migrations) MustRegister(up, down MigrationFunc)
func (*Migrations) Register ¶
func (m *Migrations) Register(up, down MigrationFunc) error
type MigrationsOption ¶
type MigrationsOption func(m *Migrations)
func WithLocksTableName ¶
func WithLocksTableName(table string) MigrationsOption
func WithTableName ¶
func WithTableName(table string) MigrationsOption
Click to show internal directories.
Click to hide internal directories.