wuwanahq / wuwana2

🇪🇺 Wuwana v2 - A webapp to help users find local suppliers in Spain.
Mozilla Public License 2.0
2 stars 2 forks source link

Database auto-upgrade #146

Open Nils85 opened 3 years ago

Nils85 commented 3 years ago

When we create a new table or change a column in an existing table we always need to execute the modifications on the database manually with SQL before updating the WebApp itself. Which is logic but not convenient.

This part should be automatic by creating an "Upgrader" class in the DataAccess namespace.

kakaye-mkubwa commented 3 years ago

Does auto-upgrading involve the retention of existing database data?

Nils85 commented 3 years ago

Yes, it is the whole point of this feature: Being able to upgrade the schema and update existing data without any action from the system administrator.

But this is not only related to the Pull Request #144, it will be used for all future features that need to create new tables or change columns, foreign keys... For now, with the PR #144, I will apply all changes by executing SQL queries directly in the database. But one day it should be good to have something automatic...

kakaye-mkubwa commented 3 years ago

Let me think on paper about how to 'safely' automate this without loosing data. If there is some lead on how to go about it, I would appreciate.

Nils85 commented 3 years ago

Well, actually I already know how to do that, I just didn't have the time to implement it before in the DataAccess Model. So I created this issue as a reminder for me...