Documentation
¶
Overview ¶
Package migrator provides utilities for database migration management.
Index ¶
Examples ¶
Constants ¶
View Source
const ( DefaultOption option = iota MigratorOption )
Define values for [option].
Variables ¶
Functions ¶
func GenerateLockKey ¶ added in v8.5.0
GenerateLockKey generates a lock key from a string.
See the benchmark results for performance comparisons between different hashing algorithms.
Example ¶
package main
import (
"fmt"
"github.com/bartventer/gorm-multitenancy/v8/pkg/migrator"
)
func main() {
key := migrator.GenerateLockKey("test")
fmt.Printf("%d", key)
}
Output: -439409999022904539
func OptionFromDB ¶
OptionFromDB retrieves the migration option from the database. If the option is not found or is not of the correct type, it returns driver.ErrInvalidMigration.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.