From 70d82ea18489a7875dff5668f6dce5335a5cc3fa Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Tue, 25 Jan 2022 22:11:05 +0000 Subject: [PATCH] Add migration for new data model --- db.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/db.go b/db.go index 7b77786..1b53dc8 100644 --- a/db.go +++ b/db.go @@ -58,6 +58,11 @@ func (h *Headscale) initDB() error { return err } + err = db.AutoMigrate(&APIKey{}) + if err != nil { + return err + } + err = h.setValue("db_version", dbVersion) return err