I'm trying to migrate two tables. Here's the code for them.
class CreateAdminFakeUserTable extends AbstractMigration
{
/**
* Migrate Up.
*/
public function up()
{
$table = $this->table('admin_fake_user');
$table->addColumn('user_id', 'integer')
->addForeignKey('user_id', 'user', 'id', array('delete' => 'CASCADE'))
->save();
}
...
}
class CreatePostsTable extends AbstractMigration
{
/**
* Migrate Up.
*/
public function up()
{
$posts = $this->table('posts');
$posts->addColumn('title', 'string', array('limit' => 40))
->addColumn('body', 'text')
->addColumn('created', 'datetime')
->save();
}
...
}
When I run $ php phinx migrate. It says both the tables have been migrated and ends successfully. But in the database I find only the posts table gets created and not the first table. Even the phinxlog table shows 2 rows; which I guess should be 1 for each table. But the first table admin_fake_user isn't being created.
I've tried rolling back and migrating again but it didn't work.
I'm trying to migrate two tables. Here's the code for them.
When I run
$ php phinx migrate. It says both the tables have beenmigratedand ends successfully. But in the database I find only thepoststable gets created and not the first table. Even thephinxlogtable shows 2 rows; which I guess should be 1 for each table. But the first tableadmin_fake_userisn't being created.I've tried rolling back and migrating again but it didn't work.