Add migration for new data model

This commit is contained in:
Kristoffer Dalby 2022-01-25 22:11:05 +00:00
parent 9dc20580c7
commit 70d82ea184
1 changed files with 5 additions and 0 deletions

5
db.go
View File

@ -58,6 +58,11 @@ func (h *Headscale) initDB() error {
return err
}
err = db.AutoMigrate(&APIKey{})
if err != nil {
return err
}
err = h.setValue("db_version", dbVersion)
return err