mirror of
https://github.com/pocketbase/pocketbase.git
synced 2024-11-28 18:11:17 +02:00
27 lines
595 B
Go
27 lines
595 B
Go
package migrations
|
|
|
|
import (
|
|
"github.com/pocketbase/dbx"
|
|
)
|
|
|
|
// This migration replaces the "authentikAuth" setting with "oidc".
|
|
func init() {
|
|
AppMigrations.Register(func(db dbx.Builder) error {
|
|
_, err := db.NewQuery(`
|
|
UPDATE {{_params}}
|
|
SET [[value]] = replace([[value]], '"authentikAuth":', '"oidcAuth":')
|
|
WHERE [[key]] = 'settings'
|
|
`).Execute()
|
|
|
|
return err
|
|
}, func(db dbx.Builder) error {
|
|
_, err := db.NewQuery(`
|
|
UPDATE {{_params}}
|
|
SET [[value]] = replace([[value]], '"oidcAuth":', '"authentikAuth":')
|
|
WHERE [[key]] = 'settings'
|
|
`).Execute()
|
|
|
|
return err
|
|
})
|
|
}
|