migration

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2025 License: BSD-3-Clause, AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateIndexIfNotExists

func CreateIndexIfNotExists[T any](ctx context.Context, db *gorm.DB, indexName string, columns ...string) error

func DropIndex

func DropIndex[T any](ctx context.Context, db *gorm.DB, indexName string) error

func GetColumnName

func GetColumnName(db *gorm.DB, column string) string

func MigrateFieldFromGobToJSON

func MigrateFieldFromGobToJSON[T any, S any](ctx context.Context, db *gorm.DB, fieldName string) error

MigrateFieldFromGobToJSON migrates a column from Gob encoding to JSON encoding. T is the type of the model that contains the field to be migrated. S is the type of the field to be migrated.

func MigrateJsonToTable

func MigrateJsonToTable[T any](ctx context.Context, db *gorm.DB, columnName string, mapperFunc func(accountID string, id string, value string) any) error

func MigrateNetIPFieldFromBlobToJSON

func MigrateNetIPFieldFromBlobToJSON[T any](ctx context.Context, db *gorm.DB, fieldName string, indexName string) error

MigrateNetIPFieldFromBlobToJSON migrates a Net IP column from Blob encoding to JSON encoding. T is the type of the model that contains the field to be migrated.

func MigrateNewField

func MigrateNewField[T any](ctx context.Context, db *gorm.DB, columnName string, defaultValue any) error

func MigrateSetupKeyToHashedSetupKey

func MigrateSetupKeyToHashedSetupKey[T any](ctx context.Context, db *gorm.DB) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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