joomla-x/joomla-pythagoras

ORM: Migrations

Opened this issue · 2 comments

Migration for ORM like Phinx :

  • Generate migration from cli
  • Management from cli and code Phinx Commands

File format like YYYYMMDDHHMMSS_my_new_migration.php
If migration don't work as planned, we can fix it and just change date to current for re-execute it

  • Method up()
  • Method down()

We can update schema with entities but we are going to loose data on column rename, etc.
What do you think about that.
Regards,

nibra commented

Yes, good idea! Actually, Phinx is already on my (internal) list as a candidate for migration handling. It should work in conjunction (or replace?) the SchemaManager (issue #101)

I'm back after some tests.
I dont think we can use both in conjuction.
Or perhaps extension developer can define a mode in config.

SchemaManager detect and apply modifications by himself on db
Migrations execute developer instructions on db with ability to make treatment on data and rollback (rollback of structure, not data).

If I am a large project based on Joomla, I would not trust an upgrade program for db changes.

Another idea, why not just able developer to generate migration file from schemamanager result before make his extension release.