[Resolved] Apply Migration To Fixture

hi

i’ve created my first migration using cdbmigration.

it’s ok for the main database.

But I can’t apply that migration to the fixtures database.

I changed the config/console.php to use the fixture db but then migration fails :




Apply the above migration? (yes|no) [no]:y

*** applying m130518_202259_rename_party_user_registration_status_to_registration_status_id

PHP Error[2]: include(m130518_202259_rename_party_user_registration_status_to_registration_status_id.php): failed to open stream: No such file or directory

    in file /data/htdocs/yii-1.1.13.e9e4a0/framework/YiiBase.php at line 421

#0 /data/htdocs/yii-1.1.13.e9e4a0/framework/YiiBase.php(421): autoload()

#1 unknown(0): autoload()

#2 /data/htdocs/yii-1.1.13.e9e4a0/framework/cli/commands/MigrateCommand.php(429): spl_autoload_call()

#3 /data/htdocs/yii-1.1.13.e9e4a0/framework/cli/commands/MigrateCommand.php(384): MigrateCommand->instantiateMigration()



if I cd in migration




seb@port party2  @ master $ cd protected/migrations/

seb@port migrations  @ master $ ../yiic migrate






Apply the above migration? (yes|no) [no]:y

*** applying m130518_202259_rename_party_user_registration_status_to_registration_status_id

PHP Fatal error:  Cannot redeclare class m130518_202259_rename_party_user_registration_status_id_to_registration_status_id_id in /data/htdocs/perso/party2/protected/migrations/m130518_202259_rename_party_user_registration_status_to_registration_status_id.php on line 27



Did someone succed applying a migration to a fixture database ?

File not found problems were because i renamed the migration files (or filename was too long or ?)

For the rest, i add a second connexion to /config/console.php




        'db' => array(

            'connectionString' => 'mysql:host=localhost;dbname=party',

            ...

        ),

        'dbtest' => array(

            'class'=>'CDbConnection',

            'connectionString' => 'mysql:host=localhost;dbname=party_fixture',

            ...

        ),



then i can run migration on test db using




./protected/yiic migrate --connectionID=dbtest