Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BuildIndexOptionsInterface ¶
type BuildIndexOptionsInterface interface {
BuildIndexOptions([]schema.IndexOption, *gorm.Statement) []interface{}
}
BuildIndexOptionsInterface build index options interface
type MigrationErr ¶
func (MigrationErr) Error ¶
func (m MigrationErr) Error() string
func (MigrationErr) Unwrap ¶
func (m MigrationErr) Unwrap() error
type MigrationModel ¶
type MigrationModel struct {
ID string `gorm:"primary_key;check:id_checker,char_length(id)=26" json:"id"`
CreatedAt time.Time `json:"created_at" gorm:"notnull"`
UpdatedAt time.Time `json:"updated_at" gorm:"notnull"`
DeletedAt soft_delete.DeletedAt `json:"-"`
Name string `json:"name" gorm:"unique"`
Status MigrationStatus `json:"status" gorm:"not null;default null"`
}
func (*MigrationModel) BeforeCreate ¶
func (a *MigrationModel) BeforeCreate(tx *gorm.DB) error
func (*MigrationModel) TableName ¶
func (a *MigrationModel) TableName() string
type MigrationStatus ¶
type MigrationStatus string
const ( MigrationStatusApplied MigrationStatus = "applied" MigrationStatusInProgress MigrationStatus = "in_progress" MigrationStatusError MigrationStatus = "error" )
type Opts ¶
type Params ¶
type Params struct {
// Models
Models []any
Migrations []Migration
// Migrations DB is what is expected to have the migrations type registered
MigrationsDB *gorm.DB
TableOpts map[string]string
Opts *Opts
// DB can be any gorm compatible db
DB *gorm.DB
DBType string
L *zap.Logger
Cfg *internal.Config
MW metrics.Writer
}
Click to show internal directories.
Click to hide internal directories.