migrate

package
v0.54.1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: BSD-3-Clause Imports: 21 Imported by: 1

Documentation

Index

Constants

View Source
const MinCompatibleRelease = "0.52.0"

MinCompatibleRelease represent the minimum release which is working with these migrations, need to update when we delete migration in our codebase

Variables

This section is empty.

Functions

func Add

func Add(ctx context.Context, migration sdk.Migration)

Add adds a migration to the list of migrations to run at API start time example of usage:

migrate.Add(sdk.Migration{Name: "MyMigration", Release: "0.39.3", Mandatory: true, ExecFunc: func(ctx context.Context) error {
	return migrate.MyMigration(ctx, a.Cache, a.DBConnectionFactory.GetDBMap)
}})

func Delete

func Delete(db gorp.SqlExecutor, mig *sdk.Migration) error

Delete migration in database.

func GetAll

func GetAll(db gorp.SqlExecutor) ([]sdk.Migration, error)

GetAll returns the migration for given name.

func GetByName

func GetByName(db gorp.SqlExecutor, name string) (*sdk.Migration, error)

GetByName returns the migration for given name.

func Insert

func Insert(db gorp.SqlExecutor, mig *sdk.Migration) error

Insert migration in database.

func MigrateBranchToRef added in v0.53.1

func MigrateBranchToRef(ctx context.Context, db *gorp.DbMap) error

func MigrateConsumers added in v0.53.0

func MigrateConsumers(ctx context.Context, db *gorp.DbMap, c cache.Store) error

func MigrateHashSignature added in v0.53.1

func MigrateHashSignature(ctx context.Context, db *gorp.DbMap, c cache.Store) error

func MigrateHeadEntity added in v0.53.1

func MigrateHeadEntity(ctx context.Context, db *gorp.DbMap) error

func MigrateProjectRepositories added in v0.53.1

func MigrateProjectRepositories(ctx context.Context, db *gorp.DbMap) error

func MigrateRunContextsToJSON added in v0.53.1

func MigrateRunContextsToJSON(ctx context.Context, db *gorp.DbMap) error

func MigrateRunJobSignature added in v0.53.1

func MigrateRunJobSignature(ctx context.Context, db *gorp.DbMap) error

func MigrateRunRepositoryInfo added in v0.53.1

func MigrateRunRepositoryInfo(ctx context.Context, db *gorp.DbMap) error

func Run

func Run(ctx context.Context, db gorp.SqlExecutor)

Run run all local migrations

func SaveAllMigrations

func SaveAllMigrations(db gorp.SqlExecutor) error

SaveAllMigrations save all local migrations marked to "done" into database (in case of a fresh installation)

func Status

Status returns monitoring status, if there are cds migration in progress it returns WARN

func Update

func Update(db gorp.SqlExecutor, mig *sdk.Migration) error

Update migration in database.

func UpdateStatus

func UpdateStatus(db gorp.SqlExecutor, id int64, status string) error

UpdateStatus update the status of a migration given its id

Types

type OldContext added in v0.53.1

type OldContext sdk.WorkflowRunContext

func (*OldContext) Scan added in v0.53.1

func (m *OldContext) Scan(src interface{}) error

func (OldContext) Value added in v0.53.1

func (m OldContext) Value() (driver.Value, error)

type UserOrganizationMigrate added in v0.53.0

type UserOrganizationMigrate struct {
	User             *sdk.AuthentifiedUser
	OrganizationName string
}

func GetOrganizationUsersToMigrate added in v0.53.0

func GetOrganizationUsersToMigrate(ctx context.Context, db *gorp.DbMap) ([]UserOrganizationMigrate, error)

Jump to

Keyboard shortcuts

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