migration

package
v0.35.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Module = fx.Module(
	"vef:approval:migration",

	fx.Invoke(autoMigrate),
)

Module provides automatic database migration for the approval module.

Functions

func Migrate

func Migrate(ctx context.Context, db orm.DB, kind config.DBKind) error

Migrate runs the approval module's DDL migration for the given database kind. Obsolete tables from earlier revisions are dropped before the schema probe so upgrades stay clean.

The migration is forward-only: each script is a set of CREATE TABLE IF NOT EXISTS statements guarded by a presence probe (needsMigration), so it provisions missing tables on a fresh or partially-migrated database but never alters an existing table. In-place column changes — an added column (e.g. the v0.33.0 action-log name snapshots added_assignee_names / removed_assignee_names / cc_user_names), a type/constraint change such as the pass_ratio rescale, or a dropped column — therefore take effect only on a freshly created database; an existing deployment that must adopt them has to be recreated. This is a hard requirement, not graceful degradation: once the code writes or reads an added column, an un-recreated older database errors on that column. The approval module is pre-1.0 and assumes recreation over in-place schema evolution; table removals are the one exception, handled explicitly through dropObsoleteTables.

Types

This section is empty.

Jump to

Keyboard shortcuts

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