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: use postgres for managed nodes #8735

Merged
merged 1 commit into from
Jan 23, 2025

Conversation

etorreborre
Copy link
Member

@etorreborre etorreborre commented Jan 10, 2025

This PR adds a Rust migration to import the data from a SQLite node to a shared Postgres database for managed nodes.

  • The main difficulty for this PR consists in passing the legacy SQLite database path down to the migration code, hence the modifications on the migrator.rs structs.

  • This migration only applies once per migrated node if the Postgres database is configured. For this specific migration we use the SQLite database to mark the node as migrated and there's no mention of that migration in the Postgres database.

  • I also simplified the return value of the migrate method which returns Result<()> now since the previously returned boolean was always true.

  • Note that this code only runs if the Postgres database is enabled.

@etorreborre etorreborre self-assigned this Jan 10, 2025
@etorreborre etorreborre force-pushed the etorreborre/feat/migrate-sqlite-to-postgres branch 4 times, most recently from e1b0bf4 to dbdaa6e Compare January 14, 2025 15:16
@etorreborre etorreborre force-pushed the etorreborre/feat/migrate-sqlite-to-postgres branch 10 times, most recently from 3d8e0bc to b953582 Compare January 22, 2025 09:12
@etorreborre etorreborre marked this pull request as ready for review January 22, 2025 10:09
@etorreborre etorreborre requested a review from a team as a code owner January 22, 2025 10:09
@etorreborre etorreborre force-pushed the etorreborre/feat/migrate-sqlite-to-postgres branch from b953582 to 18f85f5 Compare January 22, 2025 10:11
@etorreborre etorreborre enabled auto-merge January 22, 2025 13:13
@etorreborre etorreborre force-pushed the etorreborre/feat/migrate-sqlite-to-postgres branch 6 times, most recently from e57cc59 to 23b9807 Compare January 22, 2025 14:14
@etorreborre etorreborre force-pushed the etorreborre/feat/migrate-sqlite-to-postgres branch from 23b9807 to c0cd6ed Compare January 22, 2025 14:15
@etorreborre etorreborre marked this pull request as draft January 22, 2025 15:28
auto-merge was automatically disabled January 22, 2025 15:28

Pull request was converted to draft

@etorreborre etorreborre marked this pull request as ready for review January 22, 2025 17:26
@etorreborre etorreborre enabled auto-merge January 23, 2025 10:24
@etorreborre etorreborre added this pull request to the merge queue Jan 23, 2025
Merged via the queue into develop with commit 0d063d4 Jan 23, 2025
44 checks passed
@etorreborre etorreborre deleted the etorreborre/feat/migrate-sqlite-to-postgres branch January 23, 2025 10:40
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