Documentation
¶
Index ¶
- func DropDatabase(ctx context.Context, db *gorm.DB, provider string) error
- func DropTestTables(db *gorm.DB, provider string) error
- func ForceVersion(ctx context.Context, db *gorm.DB, provider string, version int) error
- func GetMigrationInfo(ctx context.Context, db *gorm.DB, provider string) (*domain.MigrationInfo, error)
- func RunDown(ctx context.Context, db *gorm.DB, provider string) error
- func RunSteps(ctx context.Context, db *gorm.DB, provider string, steps int) error
- func RunTestMigrations(db *gorm.DB, provider string) error
- func RunUp(ctx context.Context, db *gorm.DB, provider string) error
- type Migrator
- func (m *Migrator) Close() error
- func (m *Migrator) Down(ctx context.Context) error
- func (m *Migrator) Drop(ctx context.Context) error
- func (m *Migrator) Force(ctx context.Context, version int) error
- func (m *Migrator) GetMigrationInfo(ctx context.Context) (*domain.MigrationInfo, error)
- func (m *Migrator) Steps(ctx context.Context, n int) error
- func (m *Migrator) Up(ctx context.Context) error
- func (m *Migrator) Version(ctx context.Context) (uint, bool, error)
- type MigratorConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DropDatabase ¶
DropDatabase drops all tables and schema
func DropTestTables ¶
DropTestTables drops all tables for testing cleanup
func ForceVersion ¶
ForceVersion sets the migration version without running migrations
func GetMigrationInfo ¶
func GetMigrationInfo(ctx context.Context, db *gorm.DB, provider string) (*domain.MigrationInfo, error)
GetMigrationInfo returns information about migration status
func RunTestMigrations ¶
RunTestMigrations runs migrations for testing using golang-migrate with embedded files
Types ¶
type Migrator ¶
type Migrator struct {
// contains filtered or unexported fields
}
Migrator handles database migrations using golang-migrate
func NewMigrator ¶
func NewMigrator(config *MigratorConfig) (*Migrator, error)
NewMigrator creates a new migrator instance
func (*Migrator) GetMigrationInfo ¶
GetMigrationInfo returns information about migration status
Click to show internal directories.
Click to hide internal directories.