Skip to content

Commit

Permalink
Don't throw errors on users migration
Browse files Browse the repository at this point in the history
  • Loading branch information
karniv00l committed Nov 20, 2023
1 parent d8a04f8 commit dc49a56
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions migrations/1700477408_updated_users.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package migrations

import (
"encoding/json"
"fmt"

"github.com/pocketbase/dbx"
"github.com/pocketbase/pocketbase/daos"
Expand All @@ -16,7 +17,8 @@ func init() {

collection, err := dao.FindCollectionByNameOrId("users")
if err != nil {
return err
fmt.Println("collection users not found")
return nil
}

collection.ListRule = nil
Expand Down Expand Up @@ -87,7 +89,12 @@ func init() {
}`), 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 {
dao := daos.New(db);

Expand Down

0 comments on commit dc49a56

Please sign in to comment.