mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender.git
synced 2025-07-16 01:28:48 +02:00
fix:#65 updated migration files
This commit is contained in:
@ -0,0 +1,31 @@
|
||||
package migrations
|
||||
|
||||
import (
|
||||
"github.com/pocketbase/pocketbase/core"
|
||||
m "github.com/pocketbase/pocketbase/migrations"
|
||||
)
|
||||
|
||||
func init() {
|
||||
m.Register(func(app core.App) error {
|
||||
superusers, err := app.FindCollectionByNameOrId(core.CollectionNameSuperusers)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
record := core.NewRecord(superusers)
|
||||
|
||||
// note: the values can be eventually loaded via os.Getenv(key)
|
||||
// or from a special local config file
|
||||
record.Set("email", "demo@htwkalender.de")
|
||||
record.Set("password", "htwkalender-demo")
|
||||
|
||||
return app.Save(record)
|
||||
}, func(app core.App) error { // optional revert operation
|
||||
record, _ := app.FindAuthRecordByEmail(core.CollectionNameSuperusers, "demo@htwkalender.de")
|
||||
if record == nil {
|
||||
return nil // probably already deleted
|
||||
}
|
||||
|
||||
return app.Delete(record)
|
||||
})
|
||||
}
|
@ -653,7 +653,7 @@ func init() {
|
||||
},
|
||||
"name": "users",
|
||||
"oauth2": {
|
||||
"enabled": true,
|
||||
"enabled": false,
|
||||
"mappedFields": {
|
||||
"avatarURL": "",
|
||||
"id": "",
|
Reference in New Issue
Block a user