wip: versioned migrations using atlas

This commit is contained in:
2025-06-11 12:41:37 +01:00
parent 3234e5f4da
commit 8a313d089f
12 changed files with 294 additions and 35 deletions
-2
View File
@@ -29,8 +29,6 @@ func (api *API) Initialize() {
ech := echo.New()
db.Connect(api.ConfigDirectory)
db.MigrateClients()
db.MigrateUsers()
api.instance = ech
api.db = db
+5 -1
View File
@@ -33,7 +33,11 @@ func (api *API) CreateClientHandler(context echo.Context) error {
return err
}
client := api.db.CreateClient(id, body)
client, err := api.db.CreateClient(id, body)
if err != nil {
return types.Error{Code: http.StatusInternalServerError, Cause: err, Messages: []string{"Unexpected error creating User!"}}
}
return context.JSON(http.StatusOK, client)
}