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 {
|
|
|
|
if err := (domainsDAO{}).Migrate(database.Client, models.Domain{}); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
2024-04-09 13:16:19 +00:00
|
|
|
var recordDefiniation models.IRecord = &models.Record[models.RecordContentDefault]{}
|
|
|
|
if err := (recordsDAO{}).Migrate(database.Client, recordDefiniation); err != nil {
|
2024-04-09 08:28:18 +00:00
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
if err := (settingsDAO{}).Migrate(database.Client, models.Settings{}); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
2024-04-03 09:05:12 +00:00
|
|
|
}
|