refactor: initialize expert catalog from initdb
This commit is contained in:
@@ -4,5 +4,10 @@ import "gorm.io/gorm"
|
||||
|
||||
// New initializes the default database records.
|
||||
func New(database *gorm.DB) error {
|
||||
return InitUser(database)
|
||||
return database.Transaction(func(tx *gorm.DB) error {
|
||||
if err := InitUser(tx); err != nil {
|
||||
return err
|
||||
}
|
||||
return InitExpert(tx)
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user