satellite/satellitedb: fix ordering in listPendingTransitionShim

listPendingTransitionShim is a temporary transition shim intended to
make existing API processes keep working when a future DB schema change
is executed. For more explanation, see the message on commit c053bdbd70.

However, the shim has a small bug: it is missing the ORDER BY clause
that appears in the original ListPending method. This transition shim
code won't ever run until we make the DB schema change, so this bug
hasn't hurt anything yet; it's just important that we fix it before the
DB schema change happens.

Change-Id: I5953651583ee236500c2c07141dfc9d690a95118
This commit is contained in:
paul cannon 2021-10-21 18:29:07 -05:00 committed by Yingrong Zhao
parent d90a1b09a2
commit eb68dbad41

View File

@ -552,6 +552,7 @@ func (db *coinPaymentsTransactions) listPendingTransitionShim(ctx context.Contex
FROM coinpayments_transactions FROM coinpayments_transactions
WHERE status IN (?,?) WHERE status IN (?,?)
AND created_at <= ? AND created_at <= ?
ORDER BY created_at DESC
LIMIT ? OFFSET ?`) LIMIT ? OFFSET ?`)
rows, err := db.db.QueryContext(ctx, query, coinpayments.StatusPending, coinpayments.StatusReceived, before, limit+1, offset) rows, err := db.db.QueryContext(ctx, query, coinpayments.StatusPending, coinpayments.StatusReceived, before, limit+1, offset)