diff --git a/db.go b/db.go index 5136325..256f1bf 100644 --- a/db.go +++ b/db.go @@ -30,18 +30,24 @@ func (h *Headscale) initDB() error { if h.dbType == Postgres { db.Exec("create extension if not exists \"uuid-ossp\";") } + + _ = db.Migrator().RenameColumn(&Machine{}, "ip_address", "ip_addresses") + err = db.AutoMigrate(&Machine{}) if err != nil { return err } + err = db.AutoMigrate(&KV{}) if err != nil { return err } + err = db.AutoMigrate(&Namespace{}) if err != nil { return err } + err = db.AutoMigrate(&PreAuthKey{}) if err != nil { return err