Skip to content

Commit

Permalink
Add migrations for OIDC db fields.
Browse files Browse the repository at this point in the history
  • Loading branch information
knadh committed Oct 13, 2024
1 parent f8b3ddb commit 83e4f5d
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions internal/migrations/v3.1.0.go
Original file line number Diff line number Diff line change
@@ -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
}

0 comments on commit 83e4f5d

Please sign in to comment.