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

Update Feature: Database Migration #388

Closed
YaWK opened this issue Mar 18, 2023 · 2 comments
Closed

Update Feature: Database Migration #388

YaWK opened this issue Mar 18, 2023 · 2 comments
Assignees
Labels
Database Database updates Feature Feature in any kind of way Update Update related issues

Comments

@YaWK
Copy link
Owner

YaWK commented Mar 18, 2023

To make sure, the database is also updated to the latest version, db migration methods will be integrated.

@YaWK YaWK added Feature Feature in any kind of way Database Database updates labels Mar 18, 2023
@YaWK YaWK added this to the YaWK Update Feature milestone Mar 18, 2023
@YaWK YaWK self-assigned this Mar 18, 2023
@YaWK YaWK changed the title Update Feature: add database migration Update Feature: Database Migration Mar 28, 2023
@YaWK
Copy link
Owner Author

YaWK commented Mar 28, 2023

Added Transaction & Rollback - this version includes the following changes:

  • Added a $db->begin_transaction() call before the migration SQL is executed.
  • Added a $db->commit() call if the migration is successful.
  • Added a $db->rollback() call if there is an error in executing the migration SQL or recording the migration in the migrations table.

These changes ensure that the migration is executed atomically, so that either all of the changes in the migration SQL are made or none of them are applied. ("all or nothing")

YaWK added a commit that referenced this issue Mar 28, 2023
…on files between local installation and latest update to make sure db is on current state
YaWK added a commit that referenced this issue Mar 28, 2023
@YaWK YaWK added the Update Update related issues label Mar 31, 2023
@YaWK
Copy link
Owner Author

YaWK commented Apr 2, 2023

Efficient Migration Process implemented: When a migration is necessary for a particular version, the update servers will supply the required files.

Each successful database migration to a new update version will be logged in the migrations table. Only migrations not present in this table will be processed.

If an admin missed several updates and there is a significant difference in version numbers, the update process will scan each intermediate version to determine if a migration is required. If so, the migration file will be downloaded and installed sequentially.

Further enhancements will be implemented based on feedback and requirements identified during the testing phase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Database Database updates Feature Feature in any kind of way Update Update related issues
Projects
None yet
Development

No branches or pull requests

1 participant