-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 🔖 release 2.0.0 - local settings migration
This version introduces the local settings migration - Users will now have to provide their own Mapbox API key. This is a breaking change, please ensure users are provided with a Mapbox API key
- Loading branch information
Showing
18 changed files
with
1,149 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json", | ||
"changelog": "@changesets/cli/changelog", | ||
"commit": false, | ||
"fixed": [], | ||
"linked": [], | ||
"access": "restricted", | ||
"baseBranch": "master", | ||
"updateInternalDependencies": "patch", | ||
"ignore": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,5 @@ db/pb_data | |
.env | ||
**/*.exe | ||
**/*.zip | ||
db/forager | ||
db/forager | ||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Forager | ||
|
||
## 2.0.0 | ||
|
||
### Major Changes | ||
|
||
- Move environment settings to user account | ||
- Users will | ||
now have to provide thier own Mapbox API keys on account creation (this is a breaking change). | ||
- Users will now have to ensure the appropriate | ||
Pocketbase server URL is set on first launch to | ||
properly communicate with the server. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package migrations | ||
|
||
import ( | ||
"github.com/pocketbase/dbx" | ||
"github.com/pocketbase/pocketbase/daos" | ||
m "github.com/pocketbase/pocketbase/migrations" | ||
"github.com/pocketbase/pocketbase/models/schema" | ||
) | ||
|
||
func init() { | ||
m.Register(func(db dbx.Builder) error { | ||
dao := daos.New(db) | ||
|
||
collection, err := dao.FindCollectionByNameOrId("users") | ||
|
||
if err != nil { | ||
return err | ||
} | ||
|
||
collection.Schema.AddField(&schema.SchemaField{ | ||
Name: "mapboxAPIKey", | ||
Type: schema.FieldTypeText, | ||
System: false, | ||
}) | ||
|
||
err = dao.SaveCollection(collection) | ||
|
||
if err != nil { | ||
return err | ||
} | ||
|
||
return nil | ||
}, func(db dbx.Builder) error { | ||
dao := daos.New(db) | ||
|
||
collection, err := dao.FindCollectionByNameOrId("users") | ||
|
||
if err != nil { | ||
return err | ||
} | ||
|
||
mapboxAPIKeyField := collection.Schema.GetFieldByName("mapboxAPIKey") | ||
|
||
collection.Schema.RemoveField(mapboxAPIKeyField.Id) | ||
|
||
err = dao.SaveCollection(collection) | ||
|
||
if err != nil { | ||
return err | ||
} | ||
|
||
return nil | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.