1

I have started using Yii (1.1) in order to keep syncronized db schemas between different environments. My questions is: are there any easy ways to automate the writing of the Up() and Down() methods with SQL code?

At the moment, if I add a new table or alter an existing table I need to write manually these methods.

The command yiic migrate create table_name only creates an empty class. Alternatively I could create the new migration file and use the $this->exexute('sql code here') property. But I was just wondering if there is any way for Yii to detect the db changes and create the migration code on it's own

Martin
  • 1,066
  • 3
  • 20
  • 36
  • As i know, yii just creates skeleton for migration, and thats all what yii can do for you at now... – cn007b Jun 04 '15 at 19:01
  • @Martin You mean create migration with difference your models and db? Like in Doctrine(php app/console doctrine:migrations:diff)? – Danila Ganchar Jun 04 '15 at 20:35

0 Answers0