Feat: Add migration mechanism & first migration
This commit is contained in:
parent
f05bec6f17
commit
8bdbf5b0f5
25 changed files with 562 additions and 1366 deletions
|
@ -5,6 +5,8 @@ import (
|
|||
"log"
|
||||
|
||||
"github.com/pocketbase/pocketbase"
|
||||
"github.com/pocketbase/pocketbase/plugins/migratecmd"
|
||||
_ "brawlset_server/migrations"
|
||||
)
|
||||
|
||||
// Copied from https://github.com/s-petr/longhabit/blob/main/backend/main.go
|
||||
|
@ -35,6 +37,10 @@ func newApplication() *application {
|
|||
func main() {
|
||||
app := newApplication()
|
||||
|
||||
migratecmd.MustRegister(app.pb, app.pb.RootCmd, migratecmd.Config{
|
||||
Dir: "migrations",
|
||||
})
|
||||
|
||||
app.SetupCache()
|
||||
app.SetupCrons()
|
||||
app.SetupRoutes()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue