migrate

package
v1.10.5 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunMigrations

func RunMigrations(cfg MigrationConfig) error

RunMigrations runs the migrations for the given config. This function is exposed to allow embedding openFGA into applications and manage OpenFGA's database schema migrations directly. When OpenFGA is used as a library, the embedding application may have its own migration system that differs from OpenFGA's use of goose. By exposing this function, applications can: 1. Explicitly control when OpenFGA migrations run 2. Integrate OpenFGA's schema updates into their own migration workflows 3. Perform versioned upgrades of the schema as needed The function handles migrations for multiple database engines (postgres, mysql, sqlite) and supports both upgrading and downgrading to specific versions.

Types

type MigrationConfig

type MigrationConfig struct {
	Engine        string
	URI           string
	TargetVersion uint
	Timeout       time.Duration
	Verbose       bool
	Username      string
	Password      string
	Logger        logger.Logger
}

Jump to

Keyboard shortcuts

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