Skip to content
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

feat(store-indexer): clean database if outdated #1984

Merged
merged 26 commits into from
Dec 1, 2023
Merged

Conversation

holic
Copy link
Member

@holic holic commented Nov 30, 2023

detects if database is outdated (if version is present in the config table and matches the version defined in code) and, if so, empties the database by deleting all MUD-related schemas and their tables

Copy link

changeset-bot bot commented Nov 30, 2023

🦋 Changeset detected

Latest commit: 849ccd5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 30 packages
Name Type
@latticexyz/store-sync Major
@latticexyz/store-indexer Major
@latticexyz/dev-tools Major
@latticexyz/abi-ts Major
@latticexyz/block-logs-stream Major
@latticexyz/cli Major
@latticexyz/common Major
@latticexyz/config Major
create-mud Major
@latticexyz/ecs-browser Major
@latticexyz/faucet Major
@latticexyz/gas-report Major
@latticexyz/network Major
@latticexyz/noise Major
@latticexyz/phaserx Major
@latticexyz/protocol-parser Major
@latticexyz/react Major
@latticexyz/recs Major
@latticexyz/schema-type Major
@latticexyz/services Major
@latticexyz/solecs Major
solhint-config-mud Major
solhint-plugin-mud Major
@latticexyz/std-client Major
@latticexyz/std-contracts Major
@latticexyz/store-cache Major
@latticexyz/store Major
@latticexyz/utils Major
@latticexyz/world-modules Major
@latticexyz/world Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

alvrs
alvrs previously approved these changes Dec 1, 2023
Copy link
Member

@alvrs alvrs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@@ -1,5 +1,4 @@
export * from "./buildTable";
export * from "./cleanDatabase";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for context, the postgres-decoded version does not have a concept of cleaning the database if outdated correct?

Copy link
Member Author

@holic holic Dec 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is done at the store-indexer level when the process starts up (rather than at the store sync level) and there's currently no binary/command for postgres-decoded (can add that in a follow up)

Base automatically changed from holic/sync-indexer-logs to main December 1, 2023 13:37
@holic holic dismissed alvrs’s stale review December 1, 2023 13:37

The base branch was changed.

@holic holic merged commit e48fb3b into main Dec 1, 2023
10 checks passed
@holic holic deleted the holic/clean-database branch December 1, 2023 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants