Migrate namespace_id to user_id column in machine and pak

Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
This commit is contained in:
Kristoffer Dalby 2023-01-26 08:49:20 +01:00 committed by Kristoffer Dalby
parent 8dadb045cf
commit 6d669c6b9c
1 changed files with 3 additions and 0 deletions

3
db.go
View File

@ -48,6 +48,9 @@ func (h *Headscale) initDB() error {
return err 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{}, "ip_address", "ip_addresses")
_ = db.Migrator().RenameColumn(&Machine{}, "name", "hostname") _ = db.Migrator().RenameColumn(&Machine{}, "name", "hostname")