Datenbank seeder hinzugefügt

This commit is contained in:
2023-11-15 20:42:39 +01:00
parent 54fdfe30a9
commit eac3fd9a9b
9 changed files with 160 additions and 5 deletions

View File

@@ -0,0 +1,22 @@
package fakers
import (
"github.com/bxcodec/faker/v3"
"github.com/google/uuid"
"gorm.io/gorm"
"moretcgshop/app/models"
"time"
)
func UserFaker(db *gorm.DB) *models.User {
return &models.User{
ID: uuid.New().String(),
FirstName: faker.FirstName(),
LastName: faker.LastName(),
Email: faker.Email(),
Password: "$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi", // password
CreatedAt: time.Time{},
UpdatedAt: time.Time{},
DeletedAt: gorm.DeletedAt{},
}
}