migrate

package
v0.0.0-...-25d3f34 Latest Latest
Warning

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

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

Documentation

Overview

Package migrate provides migration management for the database extension

Index

Constants

This section is empty.

Variables

View Source
var Migrations = migrate.NewMigrations(
	migrate.WithMigrationsDirectory("./migrations"),
)

Migrations is the global migration collection All migrations should register themselves here using init().

View Source
var Models = []any{}

Models is the list of all models that should be auto-registered Add your models here for automatic table creation in development.

Functions

func GetMigrations

func GetMigrations() (*migrate.Migrations, error)

GetMigrations returns the migrations collection after ensuring discovery has been attempted. This should be called by code that actually uses migrations to ensure discovery happens.

func RegisterMigration

func RegisterMigration(up, down func(ctx context.Context, db *bun.DB) error)

RegisterMigration is a helper to register a migration.

func RegisterModel

func RegisterModel(model any)

RegisterModel adds a model to the auto-registration list.

Types

This section is empty.

Jump to

Keyboard shortcuts

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