## Description
Previously we check DB compatibility by making sure that we could make
select query on all columns to the DB based on the locally known schema.
This doesn't cover all cases, for instance, there could be tables in the
DB that does not exist in the local schema.
This PR changes how we do the compatibility check by fully leveraging
the migration records. It checks that the migration records in the DB
must fully match with the locally known one.
It also moves the code to sui-indexer crate, so that we could do this
check on the startup of both indexer and graphql server.
This does require that from now on we fully respect the migration
scripts, and don't do adhoc modifications on the existing migration.
## Test plan
CI
---
## 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: