Add pocketbase migrate plugin
This commit is contained in:
parent
46787e2731
commit
dd669f7c1f
1 changed files with 4 additions and 0 deletions
|
|
@ -10,6 +10,7 @@ import (
|
||||||
"github.com/pocketbase/pocketbase"
|
"github.com/pocketbase/pocketbase"
|
||||||
"github.com/pocketbase/pocketbase/apis"
|
"github.com/pocketbase/pocketbase/apis"
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/pocketbase/pocketbase/core"
|
||||||
|
"github.com/pocketbase/pocketbase/plugins/migratecmd"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Entry struct {
|
type Entry struct {
|
||||||
|
|
@ -26,6 +27,9 @@ type Project struct {
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
app := pocketbase.New()
|
app := pocketbase.New()
|
||||||
|
migratecmd.MustRegister(app, app.RootCmd, migratecmd.Config{
|
||||||
|
Automigrate: false,
|
||||||
|
})
|
||||||
|
|
||||||
app.OnServe().BindFunc(func(e *core.ServeEvent) error {
|
app.OnServe().BindFunc(func(e *core.ServeEvent) error {
|
||||||
e.Router.GET("/api/hours/{organisation}/{year}/{month}", func(c *core.RequestEvent) error {
|
e.Router.GET("/api/hours/{organisation}/{year}/{month}", func(c *core.RequestEvent) error {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue