migrations

package
v0.0.0-...-8abc9ba Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MigrationList = []*gormigrate.Migration{
	addDinosaurs(),
	addEvents(),
	addResources(),
	addConsumers(),
	dropDinosaurs(),
	addServerInstances(),
	addStatusEvents(),
	addEventInstances(),
}

MigrationList rules:

  1. IDs are numerical timestamps that must sort ascending. Use YYYYMMDDHHMM w/ 24 hour time for format Example: August 21 2018 at 2:54pm would be 201808211454.

  2. Include models inline with migrations to see the evolution of the object over time. Using our internal type models directly in the first migration would fail in future clean installs.

  3. Migrations must be backwards compatible. There are no new required fields allowed. See $project_home/g2/README.md

4. Create one function in a separate file that returns your Migration. Add that single function call to this list.

Functions

func CreateFK

func CreateFK(g2 *gorm.DB, fks ...fkMigration) error

Types

type Model

type Model struct {
	ID        string `gorm:"primary_key"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt gorm.DeletedAt `gorm:"index"`
}

Model represents the base model struct. All entities will have this struct embedded.

Jump to

Keyboard shortcuts

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