fixed references to models in migrations and use of Yii::app()->db