-
Notifications
You must be signed in to change notification settings - Fork 11.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
indexer: ensure schema always matches what diesel generated #19337
Conversation
## Description Create a script that regenerates the schema and run it to standardise our schema. Also merge `schema/mod.rs` and `schema/pg.rs` into one `schema.rs` -- otherwise we have an opportunity for things to go out of sync because a module is present in the generated schema (`pg.rs`) but not in the module entrypoint (`mod.rs`). ## Test plan ``` sui$ ./scripts/generate_indexer_schema.sh ```
## Description Run `./scripts/generate_indexer_schema.sh` during CI, so that if it changes anything, we learn about it when `changed-files.sh` runs. ## Test plan CI
The latest updates on your projects. Learn more about Vercel for Git ↗︎
3 Skipped Deployments
|
I'm expecting the CI to fail initially, because I'm not running the postgres service in the job that runs the test. My inclination is to add a new job that runs the Yet another option is to find some way to run an ephemeral cc @bmwill if you have any other ideas, or a strong preference on one of these options. |
This actually shouldn't be too hard to do in a bash script since we'll have the postgres binaries on the path. its just a few steps of:
I'm happy to help with the above since i had to get somewhat familiar with how to do this via shelling out from rust for the tempdb work |
Oh nice, I see it now -- I'll crib off |
## Description Create a script that regenerates the schema and run it to standardise our schema. Also merge `schema/mod.rs` and `schema/pg.rs` into one `schema.rs` -- otherwise we have an opportunity for things to go out of sync because a module is present in the generated schema (`pg.rs`) but not in the module entrypoint (`mod.rs`). Run this script to refresh the schema (some inconsistencies already crept in!) and set it up to run under CI. ## Test plan ``` sui$ ./scripts/generate_indexer_schema.rs` ``` and 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:
Description
Create a script that regenerates the schema and run it to standardise our schema. Also merge
schema/mod.rs
andschema/pg.rs
into oneschema.rs
-- otherwise we have an opportunity for things to go out of sync because a module is present in the generated schema (pg.rs
) but not in the module entrypoint (mod.rs
).Run this script to refresh the schema (some inconsistencies already crept in!) and set it up to run under CI.
Test plan
and 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.