migration

package
v5.3.3 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Migrate

func Migrate(_ context.Context, e *xorm.Engine, allowLong bool) error

TODO: make xormigrate context aware

Types

type DatabaseOrigin

type DatabaseOrigin string

DatabaseOrigin indicates where the database was originally created.

const (
	// OriginNew indicates a fresh database with no prior migrations.
	OriginNew DatabaseOrigin = "new"

	// OriginWoodpecker indicates the database was created by Woodpecker CI.
	OriginWoodpecker DatabaseOrigin = "woodpecker"

	// OriginCrow indicates the database was created by Crow CI.
	OriginCrow DatabaseOrigin = "crow"

	// OriginUnknown indicates the database has migrations but we can't
	// determine the origin (possibly from a modified fork).
	OriginUnknown DatabaseOrigin = "unknown"
)

type MigrationInfo

type MigrationInfo struct {
	// Origin indicates where the database came from.
	Origin DatabaseOrigin

	// AppliedMigrations lists all migration IDs found in the database.
	AppliedMigrations []string

	// UnknownMigrations lists migration IDs that are not recognized.
	// These may be from a newer version or a different fork.
	UnknownMigrations []string

	// IsFirstCrowMigration is true when this is the first time Crow
	// is running against a Woodpecker database.
	IsFirstCrowMigration bool
}

MigrationInfo contains analysis results from database migration inspection.

Source Files

Jump to

Keyboard shortcuts

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