eddiejaoude / Zend-Framework--Doctrine-ORM--PHPUnit--Ant--Jenkins-CI--TDD-

[DEPRECATED for ZF2 & Composer] Best practice Zend Framework (ZF) skeleton / base with Doctrine2 integration : High code coverage & build scripts using TDD. Issues section ar e used for project planning (features etc)
http://www.jaoudestudios.com
160 stars 40 forks source link

Doctrine Migrations #3

Open eddiejaoude opened 13 years ago

eddiejaoude commented 13 years ago

Setup database migrations

eddiejaoude commented 13 years ago

Is this best done with a module (therefore views, which could create a security issue) or as CLI scripts (/data/migrations/)?

eddiejaoude commented 13 years ago

After some thoughts i am warming towards having a module. The view will have a tool bar that would make it easier for the admin to administer the migrations, i.e. Update to revision (or latest), current database revision, possibly an audit trail (history of actions)

tombevers commented 13 years ago

I don't see the need for a module for migrations as this could become a problem to access the app if you changed the database. So migrations should be executed during the deploy of the app and not afterwards.

eddiejaoude commented 13 years ago

During development this is useful especially with multiple developers. I do see what you mean on a production server, however do you not think it would be useful when doing updates, one can update the code and then update the database, and if there are any problems, role back the code & the database more easily?

tombevers commented 13 years ago

I get your point, but its very easy to do this command line. And if there is something wrong its likely that you can't access the app.

eddiejaoude commented 13 years ago

Yes the command line is easy to do too & you are right about if something goes wrong with the application. Where would be the best place to put these files to access via the command line? The library directory does not feel right.

tombevers commented 13 years ago

I would create a bin directory in the root folder and place the migration script there. The migrations I would place in another directory database or migrations.

eddiejaoude commented 13 years ago

Sounds like a good idea. I will give it ago, thanks :)