-
Notifications
You must be signed in to change notification settings - Fork 11.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
indexer: DB reset to handle incomplete migration history (#19019)
## Description previous fix did not work well when migration run history in __diesel_schema_migrations table is not complete. I also considered dropping the database as we usually do locally, but a connection cannot drop the database in its own connection and ended up having errors of ``` cannot drop the currently open database ``` thus this pr drops all tables, functions and procedures explicitly for PG and tables for MySQL as we now only have tables in MySQL. ## Test plan 1. diesel reset on latest main 2. cherry-pick this pr to 1.31 and 1.30, run cmd below and make sure that DB are indeed reset ``` DB_POOL_SIZE=10 cargo run --bin sui-indexer -- --db-url =DB_URL --reset-db ``` --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API:
- Loading branch information
Showing
1 changed file
with
78 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters