Documentation ¶
Index ¶
- Constants
- func ReadMigrationFiles(log hclog.Logger, migrationFiles embed.FS) (map[string]map[string][]byte, error)
- type Migrator
- func (m *Migrator) Close() error
- func (m *Migrator) DowngradeProvider(version string) (retErr error)
- func (m *Migrator) DropProvider(ctx context.Context, schema map[string]*schema.Table) (retErr error)
- func (m *Migrator) FindLatestMigration(requestedVersion string) (uint, error)
- func (m *Migrator) SetVersion(requestedVersion string) (retErr error)
- func (m *Migrator) UpgradeProvider(version string) (retErr error)
- func (m *Migrator) Version() (string, bool, error)
Constants ¶
View Source
const ( Latest = "latest" Initial = "initial" Down = "down_testing" // used in testing )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Migrator ¶
type Migrator struct {
// contains filtered or unexported fields
}
func (*Migrator) DowngradeProvider ¶
func (*Migrator) DropProvider ¶
func (*Migrator) FindLatestMigration ¶
FindLatestMigration finds closet migration to the requested version
For example we have the following migrations: 1_001, 2_005, 3_009
if we ask for 007 we get 005 if we ask for 004 we get 001 if we ask for 005 we get 005
func (*Migrator) SetVersion ¶
func (*Migrator) UpgradeProvider ¶
Click to show internal directories.
Click to hide internal directories.