migration

package
v2.52.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2026 License: Apache-2.0 Imports: 31 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LatestVersion added in v2.50.0

func LatestVersion() int

LatestVersion returns the version of the most recent registered migration.

func MarkAllApplied added in v2.50.0

func MarkAllApplied(ctx context.Context, storage metadata.Storage) error

MarkAllApplied records every registered migration as applied without running any of them. It is meant for fresh deployments, where there is no data to migrate and running the migrations would needlessly block write operations while depending on services that may not be up yet.

The state file is created atomically and an existing state file is never overwritten, so instances starting in parallel converge on the same state.

func Names added in v2.52.0

func Names() []string

Names returns the names of the registered migrations, in the order they would be applied.

Types

type ImportSpaceMembersMigration

type ImportSpaceMembersMigration struct {
	// contains filtered or unexported fields
}

func (*ImportSpaceMembersMigration) Initialize

func (m *ImportSpaceMembersMigration) Initialize(cfg config)

func (*ImportSpaceMembersMigration) Migrate

func (m *ImportSpaceMembersMigration) Migrate() error

func (*ImportSpaceMembersMigration) Name

func (*ImportSpaceMembersMigration) Version

func (m *ImportSpaceMembersMigration) Version() int

type MigrationConfig

type MigrationConfig struct {
	ServiceAccountID     string
	ServiceAccountSecret string
	ProviderRegistryAddr string
}

MigrationConfig holds all caller-supplied options for a migration run. It is intentionally a plain struct so that new fields can be added without changing function signatures throughout the call chain.

type Migrations

type Migrations struct {
	// contains filtered or unexported fields
}

func New

func (*Migrations) RunMigration added in v2.52.0

func (m *Migrations) RunMigration(name string) error

RunMigration runs the named migration, whether or not it has been applied before. It exists so that an operator can repeat a migration: the import_space_members migration for instance imports space grants that were written outside of the share manager, and has to be repeatable.

The recorded version is raised if the migration is newer than it, and never lowered.

func (*Migrations) RunMigrations

func (m *Migrations) RunMigrations()

RunMigrations runs every migration that has not been applied yet, as recorded in the share manager's state.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL