Documentation ¶
Index ¶
- func ExecStatements(db *gorm.DB, statements []string) error
- type Migrate
- func (m *Migrate) Add(migration *gormigrate.Migration)
- func (m *Migrate) Close() error
- func (m *Migrate) Current() string
- func (m *Migrate) Migrate() error
- func (m *Migrate) MigrateNextTo(version string) error
- func (m *Migrate) MigratePreviousTo(version string) error
- func (m *Migrate) MigrateTo(version string) error
- func (m *Migrate) NextFrom(version string) (string, error)
- func (m *Migrate) PreviousFrom(version string) (string, error)
- func (m *Migrate) Rollback() error
- func (m *Migrate) RollbackTo(version string) error
- func (m *Migrate) SetDB(db *gorm.DB) *Migrate
- type MigrationData
- type MigrationInfo
- type NewMigrationCommand
- type ORM
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Migrate ¶
type Migrate struct { GORMigrate *gormigrate.Gormigrate // contains filtered or unexported fields }
Migrate tool, decorates gormigrate.Migration in order to provide better interface & versioning.
func (*Migrate) Add ¶
func (m *Migrate) Add(migration *gormigrate.Migration)
Add GORMigrate to migrate.
func (*Migrate) MigrateNextTo ¶
MigrateNextTo migrate to next version from specified version.
func (*Migrate) MigratePreviousTo ¶
MigratePreviousTo migrate to previous version from specified version.
func (*Migrate) PreviousFrom ¶
PreviousFrom returns previous version from passed version.
func (*Migrate) RollbackTo ¶
RollbackTo specified version.
type MigrationData ¶ added in v2.4.0
MigrationData contains base variables for the new migration.
type MigrationInfo ¶
type MigrationInfo struct {
ID string `gorm:"column:id; type:varchar(255)"`
}
MigrationInfo with migration info.
func (MigrationInfo) TableName ¶
func (MigrationInfo) TableName() string
TableName for MigrationInfo.
type NewMigrationCommand ¶
type NewMigrationCommand struct {
Directory string `short:"d" long:"directory" default:"./migrations" description:"Directory where migration will be created"` // nolint:lll
}
NewMigrationCommand struct.
func (*NewMigrationCommand) Execute ¶
func (x *NewMigrationCommand) Execute(_ []string) error
Execute migration generator command.
func (*NewMigrationCommand) FileExists ¶
func (x *NewMigrationCommand) FileExists(filename string) bool
FileExists returns true if provided file exist and it's not directory.
Click to show internal directories.
Click to hide internal directories.