diff --git a/state/migrations/20240517104423_device_list_table.go b/state/migrations/20240517104423_device_list_table.go index 1d427c0..5e6d771 100644 --- a/state/migrations/20240517104423_device_list_table.go +++ b/state/migrations/20240517104423_device_list_table.go @@ -122,6 +122,9 @@ func upDeviceListTable(ctx context.Context, tx *sql.Tx) error { Bucket: state.BucketSent, }) } + if len(deviceListRows) == 0 { + continue + } chunks := sqlutil.Chunkify(5, state.MaxPostgresParameters, state.DeviceListChunker(deviceListRows)) for _, chunk := range chunks { var placeholders []string @@ -143,8 +146,6 @@ func upDeviceListTable(ctx context.Context, tx *sql.Tx) error { ) _, err = tx.ExecContext(ctx, query, vals...) if err != nil { - fmt.Println(query) - fmt.Println(vals...) return fmt.Errorf("failed to bulk insert: %s", err) } }