Migrate DB: rename namespace, automigrate user

Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
This commit is contained in:
Kristoffer Dalby 2023-01-17 17:56:23 +01:00 committed by Juan Font
parent da5c051d73
commit 5da0963aac

4
db.go
View file

@ -187,7 +187,9 @@ func (h *Headscale) initDB() error {
return err
}
err = db.AutoMigrate(&Namespace{})
_ = db.Migrator().RenameTable("Namespace", "User")
err = db.AutoMigrate(&User{})
if err != nil {
return err
}