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

Support different schemas for Address #1697

Open
kderme opened this issue May 9, 2024 · 0 comments
Open

Support different schemas for Address #1697

kderme opened this issue May 9, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@kderme
Copy link
Contributor

kderme commented May 9, 2024

Even though db-sync already supports different insert options, most of them operate on the same db schema. The only case where this is not true is the consumed-tx-out flag, which adds a new field to the tx_out table. Since we want to optionally add a new table Address, which also requires to change the tx_out.address field, we have the following challenges:

  • An option to add the address feauture should be orthogonal to consumed-tx-out
  • This forces us to support 4 different combinations, so 4 different schemas
  • Persistent doesn't provide much flexibility for this. We may want 4 different Schema files which define at least TxOut

I think for this we can follow the same approach as we did for consumed-tx-out: Initially run the .sql file migrations and then run additional migration from Haskell code instead of .sql files. We could keep a flag in ExtraMigrations about whether the address table feauture is enabled and adjust the queries accordingly.

@kderme kderme added the enhancement New feature or request label May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: No status
Development

No branches or pull requests

1 participant