migrate

package
v1.10.1 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2025 License: Apache-2.0 Imports: 11 Imported by: 6 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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