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

improve: migration database update #3071

Merged
merged 5 commits into from
Dec 11, 2024

Conversation

dudantas
Copy link
Member

@dudantas dudantas commented Nov 7, 2024

Description

This improves the database migration process by removing the need to manually define if more migrations are required with return values in Lua scripts. The new approach automatically processes all migration files based on their version, reducing complexity and making the update process more robust. This change aims to streamline the database update logic and eliminate manual steps previously required.

Behaviour

Actual

Previously, each migration script had to explicitly return true or false to indicate whether more migrations were needed. The process required a careful, manual definition of the sequence.

Expected

The migration system now automatically identifies all migration scripts based on their filenames. It runs each migration sequentially, updating the database version accordingly, without the need for return statements to signal the end of the migrations. The logic is based purely on the migration version numbers.

Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How Has This Been Tested

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.

  • Verified the system correctly runs each migration in sequence based on file names.
  • Tested the update with a database that has multiple outdated versions, confirming each migration executes as expected.

Checklist

  • My code follows the style guidelines of this project.
  • I have performed a self-review of my own code.
  • I checked the PR checks reports.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • I have added tests that prove my fix is effective or that my feature works.

@dudantas dudantas force-pushed the dudantas/improve-migration-database-update branch from 80f2f34 to 2aa5a54 Compare November 7, 2024 07:12
@dudantas dudantas force-pushed the dudantas/improve-migration-database-update branch from 2aa5a54 to b02ea5b Compare November 7, 2024 07:15
Copy link

sonarqubecloud bot commented Nov 7, 2024

Copy link

sonarqubecloud bot commented Dec 9, 2024

@dudantas dudantas merged commit ba62a41 into main Dec 11, 2024
42 checks passed
@dudantas dudantas deleted the dudantas/improve-migration-database-update branch December 11, 2024 03:38
vasconcellosdevictor pushed a commit to vasconcellosdevictor/canary that referenced this pull request Dec 15, 2024
This improves the database migration process by removing the need to
manually define if more migrations are required with return values in
Lua scripts. The new approach automatically processes all migration
files based on their version, reducing complexity and making the update
process more robust. This change aims to streamline the database update
logic and eliminate manual steps previously required.
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.

3 participants