Documentation ¶
Index ¶
- Constants
- func Add(i api.Migration)
- func Create(p api.MigrationCreateParams) (err error)
- func DBVersion() (uint, error)
- func Down(quantity int) (err error)
- func Init(ctx context.Context, config api.Configuration, logger api.Logger) error
- func InitTool(ctx context.Context, config api.Configuration, logger api.Logger) (err error)
- func Redo() (err error)
- func Status() ([]migration.Log, error)
- func Up(quantity int) (err error)
- type DBMigrator
- func (m *DBMigrator) Create(p api.MigrationCreateParams) (err error)
- func (m *DBMigrator) DBVersion() (uint, error)
- func (m *DBMigrator) Down(quantity int) (err error)
- func (m *DBMigrator) Redo() (err error)
- func (m *DBMigrator) Status() ([]migration.Log, error)
- func (m *DBMigrator) Up(quantity int) (err error)
- type DBMigratorTool
- type Domain
- type IDBMigrator
Constants ¶
View Source
const Dialect string = "postgres"
Dialect of supported database management system
View Source
const (
// MainFileName const
MainFileName = "main.go"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DBMigrator ¶
type DBMigrator struct {
// contains filtered or unexported fields
}
DBMigrator struct
func NewDBMigrator ¶
func NewDBMigrator(ctx context.Context, config api.Configuration, logger api.Logger, repository migration.IRepository, ms migration.MigrationsList) (*DBMigrator, error)
NewDBMigrator returns a new instance of DBMigrator
func (*DBMigrator) Create ¶
func (m *DBMigrator) Create(p api.MigrationCreateParams) (err error)
Create new migration file
func (*DBMigrator) DBVersion ¶
func (m *DBMigrator) DBVersion() (uint, error)
DBVersion returns ID of last applied migration
type DBMigratorTool ¶
type DBMigratorTool struct {
*DBMigrator
}
DBMigratorTool is DBMigrator as a tool nolint
func NewDBMigratorTool ¶
func NewDBMigratorTool(m *DBMigrator) (*DBMigratorTool, error)
NewDBMigratorTool returns new DBMigratorTool
func (*DBMigratorTool) Create ¶
func (m *DBMigratorTool) Create(p api.MigrationCreateParams) (err error)
Create a migration
func (*DBMigratorTool) Down ¶
func (m *DBMigratorTool) Down(quantity int) (err error)
Down migrations
func (*DBMigratorTool) Exec ¶
func (m *DBMigratorTool) Exec(action string) (err error)
Exec migrations
Click to show internal directories.
Click to hide internal directories.