From cc74c1fa4b6bae46b4d586b3c0652115ec1e1977 Mon Sep 17 00:00:00 2001 From: bayge Date: Tue, 27 Aug 2024 17:39:03 +0930 Subject: [PATCH] Adjust database to simplify notes --- cmd/graphql.ethereum/schema.graphqls | 2 +- db/migrations/1724717941-seawater_swaps_tx_filter_fusdc.sql | 2 +- db/migrations/1724739049-init_notes.sql | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/graphql.ethereum/schema.graphqls b/cmd/graphql.ethereum/schema.graphqls index 9cbe73d1..05e09526 100644 --- a/cmd/graphql.ethereum/schema.graphqls +++ b/cmd/graphql.ethereum/schema.graphqls @@ -29,7 +29,7 @@ type Query { """ Get either global or user-specific presentation issue in anything SPN. """ - notes(wallet: String): [Note!]! + getNotes(wallet: String!): [Note!]! """ Get a pool using the address of token1 that's in the pool. diff --git a/db/migrations/1724717941-seawater_swaps_tx_filter_fusdc.sql b/db/migrations/1724717941-seawater_swaps_tx_filter_fusdc.sql index 2bc0f985..8717aad6 100644 --- a/db/migrations/1724717941-seawater_swaps_tx_filter_fusdc.sql +++ b/db/migrations/1724717941-seawater_swaps_tx_filter_fusdc.sql @@ -37,7 +37,7 @@ FROM ( transaction_hash FROM events_seawater_swap2 - WHERE created_by > after AND user_ = owner AND (to_ = fusdcAddress OR from_ = fusdcAddress) + WHERE created_by > after AND user_ = owner ORDER BY created_by DESC LIMIT limit_ ) diff --git a/db/migrations/1724739049-init_notes.sql b/db/migrations/1724739049-init_notes.sql index 21afcf24..da622b0d 100644 --- a/db/migrations/1724739049-init_notes.sql +++ b/db/migrations/1724739049-init_notes.sql @@ -14,7 +14,7 @@ CREATE TABLE notes_1 ( CREATE VIEW notes_current_1 AS SELECT * from notes_1 WHERE - from_ > CURRENT_TIMESTAMP AND - to_ < CURRENT_TIMESTAMP; + from_ < CURRENT_TIMESTAMP AND + to_ > CURRENT_TIMESTAMP; -- migrate:down