From 5da0963aac231db8c7ea0c20585015c82b9a9fa0 Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Tue, 17 Jan 2023 17:56:23 +0100 Subject: [PATCH] Migrate DB: rename namespace, automigrate user Signed-off-by: Kristoffer Dalby --- db.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/db.go b/db.go index f4aae33..e3bc552 100644 --- a/db.go +++ b/db.go @@ -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 }