Setting Up Yii To Work With Migrations

I set up my home workstation to mimic my workstation. So I can advance my Yii skills further and faster. Except I ran into a problem I didn’t have on my work machine. I changed the DB connection settings in protected/config/main.php to be localhost with the DB name I created and the root + password. I created a test table to see if my connection was good and I was able to retrieve the data of a table no problem.

I create a migration file using CMD > yiic migrate create create_dummy_table

in the up method I create a simple table ‘tbl_dummy’, array(‘id’=>‘pk’, ‘log_time’ => ‘datetime DEFAULT NULL’)

I run the CMD > yiic migrate… ends up saying it was successful but I check phpmyadmin in the DB and it isn’t there. If I create a new migration file do the same createTable code it errors and says it already exist.

Where is this "ghost" DB table being created? This has been giving me issues for 2 days now, I thought I messed up the setup and reinstalled everything to find out same issue. Many thanks in advance.

Tracing mysql will help you.

I found it is adding some migration data about the table I am trying to migrate to my localhost DB to testdrive.db in the protected/data folder… I commented that code out of the config file so I don’t know why it is defaulting to that for the migration. When using $command I can query my localhost DB no problem.