Documentation
¶
Index ¶
- type Handle
- func (m *Handle) ApplyVersion(ctx context.Context, version file.Version) error
- func (m *Handle) Close() error
- func (m *Handle) Create(name string) (*file.MigrationFile, error)
- func (m *Handle) Down(ctx context.Context) error
- func (m *Handle) Migrate(ctx context.Context, relativeN int) error
- func (m *Handle) PendingMigrations(ctx context.Context) (file.Files, error)
- func (m *Handle) Redo(ctx context.Context) error
- func (m *Handle) Reset(ctx context.Context) error
- func (m *Handle) RollbackVersion(ctx context.Context, version file.Version) error
- func (m *Handle) Up(ctx context.Context) error
- func (m *Handle) Version(ctx context.Context) (version file.Version, err error)
- func (m *Handle) Versions(ctx context.Context) (versions file.Versions, err error)
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handle ¶
type Handle struct {
// contains filtered or unexported fields
}
Handle encapsulates migrations functionality
func (*Handle) ApplyVersion ¶
ApplyVersion applies specific version.
func (*Handle) Create ¶
func (m *Handle) Create(name string) (*file.MigrationFile, error)
Create creates new migration files on disk.
func (*Handle) PendingMigrations ¶
PendingMigrations returns list of pending migration files
func (*Handle) RollbackVersion ¶
RollbackVersion runs `down` migration for specific version.
Directories
¶
Path | Synopsis |
---|---|
Package direction just holds convenience constants for Up and Down migrations.
|
Package direction just holds convenience constants for Up and Down migrations. |
Package driver holds the driver interface.
|
Package driver holds the driver interface. |
drivers
|
|
bash-driver
Package bash implements the Driver interface.
|
Package bash implements the Driver interface. |
cassandra-driver
Package cassandra implements the Driver interface.
|
Package cassandra implements the Driver interface. |
crate-driver
Package crate implements a driver for the Crate.io database
|
Package crate implements a driver for the Crate.io database |
mysql-driver
Package mysql implements the Driver interface.
|
Package mysql implements the Driver interface. |
postgresql-driver
Package postgres implements the Driver interface.
|
Package postgres implements the Driver interface. |
sqlite3-driver
Package sqlite3 implements the Driver interface.
|
Package sqlite3 implements the Driver interface. |
Package file contains functions for low-level migration files handling.
|
Package file contains functions for low-level migration files handling. |
Click to show internal directories.
Click to hide internal directories.