Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var TeamSeeder = &Seed{ Name: "Team Seeder", Run: func(db *gorm.DB) { faker := faker.New() for i := 0; i < 3; i++ { err := db.Create(&model.Team{ Name: faker.Company().Name(), Description: faker.Lorem().Text(20), }).Error if err != nil { log.Error(err) } } }, }
View Source
var TeamUserSeeder = &Seed{ Name: "Team User Relation Seeder", Run: func(db *gorm.DB) { for i := 0; i < 10; i++ { if err := db.Model(database.RandomTeam(db)).Association("Users").Append(database.RandomUser(db)); err != nil { log.Error(err) } } }, }
View Source
var UserSeeder = &Seed{ Name: "User Seeder", Run: func(db *gorm.DB) { faker := faker.New() for i := 0; i < 5; i++ { err := db.Create(&model.User{ FirstName: faker.Person().FirstName(), LastName: faker.Person().LastName(), Email: faker.Internet().Email(), Role: model.RoleAdmin, }).Error if err != nil { log.Error(err) } } }, }
Functions ¶
This section is empty.
Types ¶
Click to show internal directories.
Click to hide internal directories.