Dhinesh.B
Dhinesh.B

Reputation: 481

"Failed to open stream" error, when creating new migration

I'm trying to use the yii migration system but I'm stuck on this error when I execute this command:

   ./yiic migrate create basic_data_migrate

I get this error:

PHP Error[2]: file_get_contents(C:\Bitnami\wappstack-5.4.28-0\apache2\htdocs\cv360\protected\migrations\template.php): failed to open stream: No such file or directory
    in file C:\Bitnami\wappstack-5.4.28-0\apache2\htdocs\yii\framework\cli\commands\MigrateCommand.php at line 555

What is this template.php? How to solve this problem.

Upvotes: 3

Views: 562

Answers (1)

darkheir
darkheir

Reputation: 8950

When generating a new Migration file the Migration command is using a template to create a php file with the basic instructions.

By default Yii is using its own template file but you can define your own. In your case it seems that you set the templateFile param but you havn't any template.

In your configuration file find something like :

'commandMap' => array(
        'migrate' => array(
            'class' => 'system.cli.commands.MigrateCommand',
            'migrationPath' => 'application.migrations',
            'templateFile' => 'application.migrations.template'//This should be removed
        )
    ),

And remove the line templateFile

Upvotes: 5

Related Questions