fix: tests

This commit is contained in:
Alexis Viscogliosi 2023-12-04 09:14:10 +01:00
parent d918ffbd4a
commit 58bba4c8df
2 changed files with 2 additions and 2 deletions

View File

@ -34,7 +34,7 @@ func TestMigrate(t *testing.T) {
if tables, err := DB.Migrator().GetTables(); err != nil {
t.Fatalf("Failed to get database all tables, but got error %v", err)
} else {
for _, t1 := range []string{"users", "accounts", "pets", "companies", "toys", "languages"} {
for _, t1 := range []string{"users", "accounts", "pets", "companies", "toys", "languages", "tools"} {
hasTable := false
for _, t2 := range tables {
if t2 == t1 {

View File

@ -107,7 +107,7 @@ func OpenTestConnection(cfg *gorm.Config) (db *gorm.DB, err error) {
func RunMigrations() {
var err error
allModels := []interface{}{&User{}, &Account{}, &Pet{}, &Company{}, &Toy{}, &Language{}, &Coupon{}, &CouponProduct{}, &Order{}, &Parent{}, &Child{}}
allModels := []interface{}{&User{}, &Account{}, &Pet{}, &Company{}, &Toy{}, &Language{}, &Coupon{}, &CouponProduct{}, &Order{}, &Parent{}, &Child{}, &Tools{}}
rand.Seed(time.Now().UnixNano())
rand.Shuffle(len(allModels), func(i, j int) { allModels[i], allModels[j] = allModels[j], allModels[i] })