Add missing rows.Close

This commit is contained in:
Till Faelligen 2023-08-10 10:18:21 +02:00
parent 7dd11ac186
commit 1e7fc8c537
No known key found for this signature in database
GPG Key ID: ACCDC9606D472758

View File

@ -39,6 +39,7 @@ func upJSONB(ctx context.Context, tx *sql.Tx) error {
if err != nil {
return err
}
defer rows.Close()
// abusing PollerID here
var deviceData sync2.PollerID
@ -60,6 +61,10 @@ func upJSONB(ctx context.Context, tx *sql.Tx) error {
}
}
if rows.Err() != nil {
return rows.Err()
}
_, err = tx.ExecContext(ctx, "ALTER TABLE IF EXISTS syncv3_device_data DROP COLUMN IF EXISTS data;")
if err != nil {
return err