Skip to content

Commit 98f8adc

Browse files
committed
Missing db index.
1 parent 5726388 commit 98f8adc

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
-- Replace single-column index with composite (addressId, timestamp)
2+
ALTER TABLE `Transaction`
3+
ADD INDEX `Transaction_addressId_timestamp_idx`(`addressId`, `timestamp`),
4+
DROP INDEX `Transaction_addressId_fkey`;

prisma-local/schema.prisma

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ model Transaction {
8181
updatedAt DateTime @updatedAt
8282
8383
@@unique([hash, addressId], name: "Transaction_hash_addressId_unique_constraint")
84-
@@index([addressId], map: "Transaction_addressId_fkey")
84+
@@index([addressId, timestamp], map: "Transaction_addressId_timestamp_idx")
8585
}
8686

8787
model Wallet {

0 commit comments

Comments
 (0)