Extend model with sections & model
This commit is contained in:
parent
6b8cac30ce
commit
f491fdd9f4
4 changed files with 77 additions and 1 deletions
|
|
@ -30,8 +30,23 @@ func connectDatabase() (*gorm.DB, error) {
|
|||
sqlite.Open(config.Database.Location),
|
||||
&gorm.Config{},
|
||||
)
|
||||
if err != nil {
|
||||
// TODO: Handle exception
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
database.AutoMigrate(&models.User{})
|
||||
err = database.AutoMigrate(
|
||||
&models.User{},
|
||||
&models.ParentSection{},
|
||||
&models.Section{},
|
||||
&models.Person{},
|
||||
&models.ManageSection{},
|
||||
&models.ManageParentSection{},
|
||||
)
|
||||
if err != nil {
|
||||
// TODO: Handle exception
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
connected = true
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue