Skip to content
Snippets Groups Projects
Commit aa07f6b0 authored by gbe's avatar gbe
Browse files

Log migrations

parent 8060d43c
No related branches found
No related tags found
No related merge requests found
......@@ -202,6 +202,8 @@ func migrateUsers(ctx context.Context, b *bolt.DB, sqlTx *sqlx.Tx) error {
name := string(k)
pwhash := string(v)
log.Println("migrating user", name)
_, err := sqlTx.ExecContext(ctx, `INSERT INTO users (name, password) VALUES (?1, ?2)`, name, pwhash)
return err
})
......@@ -234,6 +236,8 @@ func migrateWines(ctx context.Context, b *bolt.DB, sqlTx *sqlx.Tx) error {
return err
}
log.Println("migrating wine", u.String(), "with name", v.Name)
data := bucket.Bucket(k)
if data == nil {
return fmt.Errorf("no data for %q", k)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment