samdark, on 12 July 2013 - 06:04 AM, said:
It's by design. You should never use model in migrations since model code can be changed slightly while one should be able to run migrations from the very first (where model was different) to the current.
Two questions here:
1. How to import model to migration, when (temporarily) ignoring your advice? Neither this:
PHP Error: include(C:\XAMPP\websites\website\protected\models\Content.php):
failed to open stream: No such file or directory
in file C:\XAMPP\websites\yii\framework\YiiBase.php at line 404
2. Following previous one. How to deal with the situation like above, that you have a constant defined in your model and you want to use it in migration?
I've solved above with:
But this looks like a pretty ugly way of doing this. Is there a better way?