-
Notifications
You must be signed in to change notification settings - Fork 112
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
TimescaleDB: Add psql to timescaledb migration scripts #1364
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1364 +/- ##
=========================================
Coverage 85.36% 85.36%
- Complexity 364 365 +1
=========================================
Files 257 257
Lines 6367 6367
Branches 689 689
=========================================
Hits 5435 5435
Misses 707 707
Partials 225 225 Continue to review full report at Codecov.
|
23714ea
to
4793003
Compare
hedera-mirror-importer/src/main/resources/db/migration/v2/V2.0.0__time_scale_init.sql
Outdated
Show resolved
Hide resolved
hedera-mirror-importer/src/main/resources/db/scripts/time-scale-migration/createHyperTables.sql
Outdated
Show resolved
Hide resolved
hedera-mirror-importer/src/main/resources/db/scripts/time-scale-migration/csvBackupTables.sql
Outdated
Show resolved
Hide resolved
...a-mirror-importer/src/main/resources/db/scripts/time-scale-migration/timeScaleDbMigration.sh
Outdated
Show resolved
Hide resolved
hedera-mirror-importer/src/main/resources/db/scripts/time-scale-migration/alterSchema.sql
Outdated
Show resolved
Hide resolved
hedera-mirror-importer/src/main/resources/db/scripts/init_v2.sql
Outdated
Show resolved
Hide resolved
7fe49cc
to
9345041
Compare
hedera-mirror-importer/src/main/resources/db/migration/v2/V2.0.2__time_scale_index_init.sql
Show resolved
Hide resolved
hedera-mirror-importer/src/main/resources/db/migration/v2/V2.0.2__time_scale_index_init.sql
Outdated
Show resolved
Hide resolved
hedera-mirror-importer/src/main/resources/db/migration/v2/V2.0.2__time_scale_index_init.sql
Outdated
Show resolved
Hide resolved
hedera-mirror-importer/src/main/resources/db/scripts/init_v2.sql
Outdated
Show resolved
Hide resolved
hedera-mirror-importer/src/main/resources/db/scripts/init_v2.sql
Outdated
Show resolved
Hide resolved
hedera-mirror-importer/src/main/resources/db/scripts/timescaledb/migration.sh
Outdated
Show resolved
Hide resolved
Signed-off-by: Nana-EC <[email protected]>
Signed-off-by: Nana-EC <[email protected]>
Signed-off-by: Nana-EC <[email protected]>
Signed-off-by: Nana-EC <[email protected]>
Signed-off-by: Nana-EC <[email protected]>
Signed-off-by: Nana-EC <[email protected]>
Signed-off-by: Nana-EC <[email protected]>
Signed-off-by: Nana-EC <[email protected]>
Signed-off-by: Nana-EC <[email protected]>
Signed-off-by: Nana-EC <[email protected]>
Signed-off-by: Nana-EC <[email protected]>
Signed-off-by: Nana-EC <[email protected]>
Signed-off-by: Nana-EC <[email protected]>
Signed-off-by: Nana-EC <[email protected]>
Signed-off-by: Nana-EC <[email protected]>
…mary keys Signed-off-by: Nana-EC <[email protected]>
Signed-off-by: Nana-EC <[email protected]>
Signed-off-by: Nana-EC <[email protected]>
579f86e
to
2af6559
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* Fix token_account primary index #1364 updated the token_account table to have a primary index on the timestamp. However, an account can be associated with multiple tokens in a single TokenAssociate transaction. - Update `V1.33.0__drop_token_account_id.sql` migration file to set `token_account` primary index to use `created_timestamp, token_id` - Update `V2.0.2__time_scale_index_init.sql` file to set `token_account` primary index to use `created_timestamp, token_id` - Update `TokenAccountRepositoryTest` with test to capture scenario Signed-off-by: Nana-EC <[email protected]>
Detailed description:
Mirror node using existing v1 schema will need to migrate from a postgres db to a new timescaledb.
We should offer some scripts to help operators migrate with ease
csvBackupTables.sql
file that backs up v1 tables to separate csv files for future restorecreateHyperTables.sql
file that updated the table schema differences and create Hyper table prior to restorecsvRestoreTables.sql
file that uses COPY to restore back files for each of the tablesupdateSchema.sql
file that handles schema difference and runs after data migration to ensure data is in syncmigration.config
file that hold the config values for a script to run all the migration stepsmigration.sh
main script that orchestrates the migration utilizing all the stagesinit_v2.sql
file that may be used to initiate a timescale db node by creating the database and users with appropriate permissionsinit.sql
toinit_v1.sql
installation.md
file with instruction on timescaledb setupoperations.md
file with instructions on v1 to v2 migration procedureWhich issue(s) this PR fixes:
Fixes #1309
Special notes for your reviewer:
Verified flow in
To-do:
Checklist