Hey friends, I am having trouble applying my most recent migration. I have deleted and recreated the migration file using yiic, and I have also deleted the migration from my database. Test migrations work fine, and the yiibase file exists.
Here’s my terminal:
Total 1 new migration to be applied:
m150630_153901_create_notification_table
Apply the above migration? (yes|no) [no]:yes
*** applying m150630_153901_create_notification_table
PHP Error[2]: include(m150630_153901_create_notification_table.php): failed to open stream: No such file or directory
in file /home/keenan/work/new-website/yii/framework/YiiBase.php at line 427
#0 /home/keenan/work/new-website/yii/framework/YiiBase.php(427): autoload()
#1 unknown(0): autoload()
#2 /home/keenan/work/new-website/yii/framework/cli/commands/MigrateCommand.php(429): spl_autoload_call()
#3 /home/keenan/work/new-website/yii/framework/cli/commands/MigrateCommand.php(384): MigrateCommand->instantiateMigration()
#4 /home/keenan/work/new-website/yii/framework/cli/commands/MigrateCommand.php(109): MigrateCommand->migrateUp()
#5 unknown(0): MigrateCommand->actionUp()
#6 /home/keenan/work/new-website/yii/framework/console/CConsoleCommand.php(172): ReflectionMethod->invokeArgs()
#7 /home/keenan/work/new-website/yii/framework/console/CConsoleCommandRunner.php(71): MigrateCommand->run()
#8 /home/keenan/work/new-website/yii/framework/console/CConsoleApplication.php(92): CConsoleCommandRunner->run()
#9 /home/keenan/work/new-website/yii/framework/base/CApplication.php(180): CConsoleApplication->processRequest()
#10 /home/keenan/work/new-website/yii/framework/yiic.php(33): CConsoleApplication->run()
#11 /home/keenan/work/new-website/yii/musistic/protected/yiic.php(7): require_once()
#12 /home/keenan/work/new-website/yii/musistic/protected/yiic(4): require_once()
Here’s my model:
<?php
class Notification extends CActiveRecord
{
public function tableName()
{
return 'tbl_notification';
}
public function relations()
{
'user' => array(self::BELONGS_TO, 'User', 'user_id');
}
/**
* Returns the static model of the specified AR class.
* Please note that you should have this exact method in all your CActiveRecord descendants!
* @param string $className active record class name.
* @return User the static model class
*/
public static function model($className=__CLASS__)
{
return parent::model($className);
}
}
?>
For added measure, here’s the place in the yiibase file where the error is being thrown:
...
...
if(self::$enableIncludePath===false)
{
foreach(self::$_includePaths as $path)
{
$classFile=$path.DIRECTORY_SEPARATOR.$className.'.php';
if(is_file($classFile))
{
include($classFile);
if(YII_DEBUG && basename(realpath($classFile))!==$className.'.php')
throw new CException(Yii::t('yii','Class name "{class}" does not match class file "{file}".', array(
'{class}'=>$className,
'{file}'=>$classFile,
)));
break;
}
}
}
else
include($className.'.php'); //<------- error is thrown here
...
...
I’m honestly not sure where I’m going wrong. Any insight would be heartily appreciated.