CodeIgniter Forums
Suggested Migration strategy - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Feature Requests (https://forum.codeigniter.com/forumdisplay.php?fid=29)
+--- Thread: Suggested Migration strategy (/showthread.php?tid=67443)



Suggested Migration strategy - baselbj - 02-23-2017

Hi,

I updated CI4 Database/MigrationRunner.php to fix all issues and add support migrations per module. The idea is to make the migration class supporting migration per module so that each module (Namespace) have it's own versioning sequence.

This will allow each module to be: added, updated, and deleted without affecting other modules. to explain the idea lets suppose that we have a website that we need to add a new chat module (migration number 9) to it and later we added a new blogging module to it (migration number 10).

After few months you decide to remove the chat module. With current migration strategy we can't use migration to delete the chat tables (9) as that we should first remove the blog tables (10). 

As with my current solution every module could have its own migration sequence this problem is solved.

Please find attached my suggested file update for more information.


RE: Suggested Migration strategy - ciadmin - 02-23-2017

If you are proposing a change to the framework, this would be done through a pull request on https://github.com/bcit-ci/CodeIgniter4


RE: Suggested Migration strategy - kilishan - 02-23-2017

I like the idea, but as ciadmin said - please provide it as a pull request.


RE: Suggested Migration strategy - baselbj - 02-23-2017

Thank you I will provide a pull ... the code is already done and tested ...

please not that I found some issues in the code that is fixed with my version and I will explain all points in the pull Smile