migrations

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Migrate

func Migrate(db *gorm.DB) error

Migrate migrates the database schema and/or data to the current version.

Types

type Migration

type Migration interface {
	Description() string
	Migrate(*gorm.DB) error
}

func NewMigration

func NewMigration(desc string, fn func(*gorm.DB) error) Migration

type Version

type Version struct {
	ID      int64
	Version int64
}

Version represents the version table. It should have only one row with `id == 1`.

Jump to

Keyboard shortcuts

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