Fix auto migrations
This commit is contained in:
parent
7225c76f05
commit
d8a04f8f5f
|
@ -2,6 +2,7 @@ package migrations
|
|||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
|
||||
"github.com/pocketbase/dbx"
|
||||
"github.com/pocketbase/pocketbase/daos"
|
||||
|
@ -11,6 +12,14 @@ import (
|
|||
|
||||
func init() {
|
||||
m.Register(func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
_, err := dao.FindCollectionByNameOrId("9eif9v40b0uw9l8")
|
||||
|
||||
if err == nil {
|
||||
fmt.Println("collection iniFiles already exists")
|
||||
return nil
|
||||
}
|
||||
|
||||
jsonData := `{
|
||||
"id": "9eif9v40b0uw9l8",
|
||||
"created": "2023-11-20 10:50:08.919Z",
|
||||
|
|
|
@ -2,6 +2,7 @@ package migrations
|
|||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
|
||||
"github.com/pocketbase/dbx"
|
||||
"github.com/pocketbase/pocketbase/daos"
|
||||
|
@ -11,6 +12,14 @@ import (
|
|||
|
||||
func init() {
|
||||
m.Register(func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
_, err := dao.FindCollectionByNameOrId("9eif9v40b0uw9l8")
|
||||
|
||||
if err == nil {
|
||||
fmt.Println("collection stargazers already exists")
|
||||
return nil
|
||||
}
|
||||
|
||||
jsonData := `{
|
||||
"id": "z8cojwcvlyxxyll",
|
||||
"created": "2023-11-20 10:50:08.921Z",
|
||||
|
|
|
@ -2,6 +2,7 @@ package migrations
|
|||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
|
||||
"github.com/pocketbase/dbx"
|
||||
"github.com/pocketbase/pocketbase/daos"
|
||||
|
@ -11,6 +12,14 @@ import (
|
|||
|
||||
func init() {
|
||||
m.Register(func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
_, err := dao.FindCollectionByNameOrId("9eif9v40b0uw9l8")
|
||||
|
||||
if err == nil {
|
||||
fmt.Println("collection tunes already exists")
|
||||
return nil
|
||||
}
|
||||
|
||||
jsonData := `{
|
||||
"id": "5djmpehuiigg06b",
|
||||
"created": "2023-11-20 10:50:08.921Z",
|
||||
|
|
|
@ -14,7 +14,7 @@ func init() {
|
|||
m.Register(func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("_pb_users_auth_")
|
||||
collection, err := dao.FindCollectionByNameOrId("users")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue