frappe / books

Free Accounting Software
https://frappe.io/books
GNU Affero General Public License v3.0
2.68k stars 614 forks source link

💡 [Feature Request] - Iterative (and consistent) Patching #867

Open Isaac-GC opened 3 months ago

Isaac-GC commented 3 months ago

Summary

The database will be checked to see if a patch has been applied, and if not, applies the patch regardless of the version.

What problem are you trying to solve?

As patching the database only applies to a single hardcoded value (i.e. v0.2). After the very next patch release, the first patch won't be applied, creating a non-linear and inconsistent database patching methodology.

For example: If patch A is released for v0.2, but the user upgrades directly to v0.3 from v0.1, bypassing v0.2, the patch won't properly be applied.

Basic Example

The database (either internally to the DB and/or via an embedded schema asset in the application) will contain a history of the applied patches as well current version of the database. By doing it this way, even if application versions are bypassed, the patches will still be incrementally/consistently applied, ensuring repeatable outputs.

Drawbacks

Patches will need to be retroactively ported to this new patching methodology and the whole system will be a medium to large-ish undertaking to ensure the system works as expected and won't impact users.

Reference Issues

No response