migrate

package
v0.0.0-...-724610a Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2024 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Init = &gormigrate.Migration{
	ID: "20240624-init",
	Migrate: func(tx *gorm.DB) error {
		return tx.AutoMigrate(
			&models.Cert{},
			&models.CertDNS{},
			&models.CertUser{},
			&models.Cron{},
			&models.Database{},
			&models.Monitor{},
			&models.Plugin{},
			&models.Setting{},
			&models.Task{},
			&models.User{},
			&models.Website{},
		)
	},
	Rollback: func(tx *gorm.DB) error {
		return tx.Migrator().DropTable(
			&models.Cert{},
			&models.CertDNS{},
			&models.CertUser{},
			&models.Cron{},
			&models.Database{},
			&models.Monitor{},
			&models.Plugin{},
			&models.Setting{},
			&models.Task{},
			&models.User{},
			&models.Website{},
		)
	},
}

Functions

func Migrate

func Migrate(db *gorm.DB)

Types

This section is empty.

Jump to

Keyboard shortcuts

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