reCoreD-UI/controllers/migrate.go

23 lines
488 B
Go
Raw Normal View History

2024-04-03 09:05:12 +00:00
package controllers
2024-04-09 08:28:18 +00:00
import (
"reCoreD-UI/database"
"reCoreD-UI/models"
)
func Migrate() error {
2024-04-11 02:51:50 +00:00
if err := (domainsDAO{}).Migrate(database.Client, &models.Domain{}); err != nil {
2024-04-09 08:28:18 +00:00
return err
}
2024-04-11 02:51:50 +00:00
if err := (recordsDAO{}).Migrate(database.Client, &models.Record[models.RecordContentDefault]{Content: make(models.RecordContentDefault)}); err != nil {
2024-04-09 08:28:18 +00:00
return err
}
2024-04-11 02:51:50 +00:00
if err := (settingsDAO{}).Migrate(database.Client, &models.Settings{}); err != nil {
2024-04-09 08:28:18 +00:00
return err
}
return nil
2024-04-03 09:05:12 +00:00
}