mirror of
https://github.com/knadh/listmonk.git
synced 2025-03-01 16:55:26 +08:00
Add migrations for OIDC db fields.
This commit is contained in:
parent
f8b3ddb5ee
commit
83e4f5def4
1 changed files with 23 additions and 0 deletions
23
internal/migrations/v3.1.0.go
Normal file
23
internal/migrations/v3.1.0.go
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
package migrations
|
||||||
|
|
||||||
|
import (
|
||||||
|
"log"
|
||||||
|
|
||||||
|
"github.com/jmoiron/sqlx"
|
||||||
|
"github.com/knadh/koanf/v2"
|
||||||
|
"github.com/knadh/stuffbin"
|
||||||
|
)
|
||||||
|
|
||||||
|
// V3_1_0 performs the DB migrations.
|
||||||
|
func V3_1_0(db *sqlx.DB, fs stuffbin.FileSystem, ko *koanf.Koanf, lo *log.Logger) error {
|
||||||
|
// Insert new preference settings.
|
||||||
|
if _, err := db.Exec(`
|
||||||
|
INSERT INTO settings (key, value) VALUES
|
||||||
|
('security.oidc', '{"enabled": false, "provider_url": "", "client_id": "", "client_secret": ""}'),
|
||||||
|
ON CONFLICT DO NOTHING;
|
||||||
|
`); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
Loading…
Reference in a new issue