seeds

package
v0.0.0-...-834c3ea Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(db *database.DB, tableName string) error

Add adds seed data for a table to the DB.

func AddAll

func AddAll(db *database.DB) error

AddAll adds all seed data to the DB.

func FakeUsers

func FakeUsers(count int) ([]models.User, error)

FakeUsers returns fake user details.

func Remove

func Remove(db *database.DB, tableName string) error

Remove removes seed data for a table in the DB.

func RemoveAll

func RemoveAll(db *database.DB) error

RemoveAll removes all seed data in the DB.

Types

type Seed

type Seed struct {
	models.Base
	TableName string
	SeedID    uuid.UUID `gorm:"type:uuid"`
}

Seed represents a seed in the database.

Jump to

Keyboard shortcuts

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