feat: update database schema to v1.1.7 #242
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request updates the RSK Explorer database schema and Prisma models to improve query performance and consistency. The main changes are the addition of several composite and unique indexes across key tables, a fix to a column naming inconsistency, and alignment between the SQL schema and Prisma models.
Indexing improvements for performance:
balance
table for(address, id)
and(address, block_number)
to speed up lookups by address and block context. [1] [2]event
table for(address, event, event_id)
and for(event)
, improving event query efficiency. [1] [2]transaction
table for(block_number, transaction_index)
in various sort orders, improving transaction retrieval and ensuring uniqueness. [1] [2] [3]verification_result
table onaddress
andmatch
columns to improve contract verification queries. [1] [2]Schema consistency and naming fixes:
is_successful
column name in thetransaction
table and Prisma model (was previouslyisSuccessful
in some places), ensuring consistency between the SQL schema and Prisma. [1] [2]Prisma model alignment:
balance
,event
,transaction
, andverification_result
models. [1] [2] [3] [4] [5]These changes will make queries more efficient and maintainable, and ensure the Prisma models accurately reflect the underlying database schema.