diff --git a/database/seed.go b/database/seed.go index 3ea3e1c..ef49a73 100644 --- a/database/seed.go +++ b/database/seed.go @@ -23,21 +23,21 @@ func MustApplyDatabaseSeed(file string, db *gorm.DB, excludedTables ...[]string) applySeedCheckSQL := ` SELECT - SUM(TABLE_ROWS) AS rows2 + SUM(TABLE_ROWS) AS 'rows' FROM information_schema.TABLES WHERE TABLE_SCHEMA = ? AND TABLE_NAME NOT IN ? ` result := struct { - Rows2 uint64 + Rows uint64 }{} statement := db.Raw(applySeedCheckSQL, db.Migrator().CurrentDatabase(), excludedTablesInSQL) if err := statement.Scan(&result).Error; err != nil { panic(fmt.Errorf("failed to check whether seed should be applied: %w", err)) } - if result.Rows2 > 0 { + if result.Rows > 0 { return }