Component evidence

Error (gormigrate.go)

gormigrate · gormigrate.go · go · MIT
database

A minimalistic migration helper for Gorm that allows developers to manage database schema changes and rollbacks using versioned migration scripts.

Source preview first 800 characters · full source over MCP
// 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)