Recently I’ve completed YF db migrations functionality.
Source located here:
https://github.com/yfix/yf/blob/master/classes/db/yf_db_migrator.class.php
There are console helpers:
yf db:migrate compare
yf db:migrate generate
yf db:migrate create
yf db:migrate apply
yf db:migrate list
yf db:migrate dump
General commands:
* compare – will output differencies between current project db structure and expected php_sql db structure, stored in files inside framework and project. Computes differencies in:
tables, columns, indexes, foreign keys. Report about missing or new items and about changed items too.
* generate – will output internal migration commands, not writing anything to disk, useful to figure out how created migration can look like
* create – create new migration file into disk, based on compare result. Usually store file into APP_PATH/share/db/migrations/%new_migration_file%.php.
This method useful to store changes into database for future applying on other hosts.
* apply – apply selected migration into project database. Useful for applying database changes in controlled and repeatable manner.
* list – list available migrations to apply
* dump – dump current database structure into disk into sql_php files.