Don't throw errors on users migration
This commit is contained in:
parent
d8a04f8f5f
commit
dc49a56784
|
@ -2,6 +2,7 @@ package migrations
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
|
|
||||||
"github.com/pocketbase/dbx"
|
"github.com/pocketbase/dbx"
|
||||||
"github.com/pocketbase/pocketbase/daos"
|
"github.com/pocketbase/pocketbase/daos"
|
||||||
|
@ -16,7 +17,8 @@ func init() {
|
||||||
|
|
||||||
collection, err := dao.FindCollectionByNameOrId("users")
|
collection, err := dao.FindCollectionByNameOrId("users")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
fmt.Println("collection users not found")
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
collection.ListRule = nil
|
collection.ListRule = nil
|
||||||
|
@ -87,7 +89,12 @@ func init() {
|
||||||
}`), edit_avatar)
|
}`), edit_avatar)
|
||||||
collection.Schema.AddField(edit_avatar)
|
collection.Schema.AddField(edit_avatar)
|
||||||
|
|
||||||
return dao.SaveCollection(collection)
|
error := dao.SaveCollection(collection)
|
||||||
|
if error != nil {
|
||||||
|
fmt.Println(error)
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
}, func(db dbx.Builder) error {
|
}, func(db dbx.Builder) error {
|
||||||
dao := daos.New(db);
|
dao := daos.New(db);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue