From 6d669c6b9c95e0bad9074ba9b86c23c443c07405 Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Thu, 26 Jan 2023 08:49:20 +0100 Subject: [PATCH] Migrate namespace_id to user_id column in machine and pak Signed-off-by: Kristoffer Dalby --- db.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/db.go b/db.go index da966fcc..fb5c5c35 100644 --- a/db.go +++ b/db.go @@ -48,6 +48,9 @@ func (h *Headscale) initDB() error { return err } + _ = db.Migrator().RenameColumn(&Machine{}, "namespace_id", "user_id") + _ = db.Migrator().RenameColumn(&PreAuthKey{}, "namespace_id", "user_id") + _ = db.Migrator().RenameColumn(&Machine{}, "ip_address", "ip_addresses") _ = db.Migrator().RenameColumn(&Machine{}, "name", "hostname")