Package gormigrate is a minimalistic migration helper for Gorm (http://gorm.io)
// Source: https://github.com/go-gormigrate/gormigrate | License: MIT | Copyright 2016 Andrey Nering
// Provided via justclaw.it.com; keep this notice with the code.
// Package gormigrate is a minimalistic migration helper for Gorm (http://gorm.io)
package gormigrate
import (
"context"
"errors"
"fmt"
"reflect"
"gorm.io/gorm"
)
const (
initSchemaMigrationID = "SCHEMA_INIT"
)
// MigrateFunc is the func signature for migrating.
type MigrateFunc func(*gorm.DB) error
// RollbackFunc is the func signature for rollbacking.
type RollbackFunc func(*gorm.DB) error
// InitSchemaFunc is the func signature for initializing the schema.
type InitSchemaFunc func(*gorm.DB) error
// Options define options for all migrations.
type Options struct {
// TableName is the migration table.
TableName
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key