Documentation
¶
Overview ¶
Package migration provides integration with Flyway for database migrations
Index ¶
- type Config
- type FlywayMigrator
- func (fm *FlywayMigrator) GetDefaultMigrationConfig() *Config
- func (fm *FlywayMigrator) Info(ctx context.Context, cfg *Config) error
- func (fm *FlywayMigrator) Migrate(ctx context.Context, cfg *Config) error
- func (fm *FlywayMigrator) RunMigrationsAtStartup(ctx context.Context) error
- func (fm *FlywayMigrator) Validate(ctx context.Context, cfg *Config) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { FlywayPath string // Path to the Flyway executable ConfigPath string // Path to the configuration file MigrationPath string // Path to migration scripts Timeout time.Duration // Timeout for migration operations Environment string // Environment (development, testing, production) DryRun bool // Only validate, do not execute }
Config configuration for migrations
type FlywayMigrator ¶
type FlywayMigrator struct {
// contains filtered or unexported fields
}
FlywayMigrator handles database migrations using Flyway
func NewFlywayMigrator ¶
func NewFlywayMigrator(cfg *config.Config, log logger.Logger) *FlywayMigrator
NewFlywayMigrator creates a new instance of the migrator
func (*FlywayMigrator) GetDefaultMigrationConfig ¶
func (fm *FlywayMigrator) GetDefaultMigrationConfig() *Config
GetDefaultMigrationConfig gets the default configuration for migrations
func (*FlywayMigrator) Info ¶
func (fm *FlywayMigrator) Info(ctx context.Context, cfg *Config) error
Info shows information about the status of migrations
func (*FlywayMigrator) Migrate ¶
func (fm *FlywayMigrator) Migrate(ctx context.Context, cfg *Config) error
Migrate executes pending migrations
func (*FlywayMigrator) RunMigrationsAtStartup ¶
func (fm *FlywayMigrator) RunMigrationsAtStartup(ctx context.Context) error
RunMigrationsAtStartup executes migrations automatically at application startup
Click to show internal directories.
Click to hide internal directories.