migrations

package
v0.0.0-...-d3f7758 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MigrationList = []*gormigrate.Migration{
	addDinosaurs(),
	addEvents(),
}

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