diff --git a/.gitignore b/.gitignore index a123afb..c0012b9 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,6 @@ beszel-agent beszel_data beszel_data* dist -*.exe \ No newline at end of file +*.exe +beszel/cmd/hub/hub +beszel/cmd/agent/agent diff --git a/beszel/cmd/hub/hub.go b/beszel/cmd/hub/hub.go index 428db4e..ffbe825 100644 --- a/beszel/cmd/hub/hub.go +++ b/beszel/cmd/hub/hub.go @@ -4,6 +4,7 @@ import ( "beszel" "beszel/internal/hub" "beszel/internal/update" + _ "beszel/migrations" "github.com/pocketbase/pocketbase" "github.com/spf13/cobra" diff --git a/beszel/internal/hub/hub.go b/beszel/internal/hub/hub.go index d78de0c..335fa6b 100644 --- a/beszel/internal/hub/hub.go +++ b/beszel/internal/hub/hub.go @@ -57,6 +57,7 @@ func (h *Hub) Run() { migratecmd.MustRegister(h.app, h.app.RootCmd, migratecmd.Config{ // (the isGoRun check is to enable it only during development) Automigrate: isGoRun, + Dir: "../../migrations", }) // set auth settings diff --git a/beszel/migrations/1722186612_collections_snapshot.go b/beszel/migrations/1722186612_collections_snapshot.go index e6fcadb..6cf10b5 100644 --- a/beszel/migrations/1722186612_collections_snapshot.go +++ b/beszel/migrations/1722186612_collections_snapshot.go @@ -1,4 +1,4 @@ -package main +package migrations import ( "encoding/json" diff --git a/beszel/migrations/initial-settings.go b/beszel/migrations/initial-settings.go index 22907f7..c528245 100644 --- a/beszel/migrations/initial-settings.go +++ b/beszel/migrations/initial-settings.go @@ -1,4 +1,4 @@ -package main +package migrations import ( "github.com/pocketbase/dbx"