Wanna put your code here?
But my bet is that you don't call updated(), create() or save()
It should looks like this:
$this->table('tbl')
->addColumn(...)
->addColumn(...)
->addColumn(...)
->addIndex(...)
// this is the method that actually execute the query
->create()
Follow the procedures I've done
public function up()
{
$users = $this->table('teste');
$users->addColumn('nome', 'string', array('limit' => 100))
->addColumn('sobrenome', 'string', array('limit' => 100))
->addColumn('email', 'string', array('limit' => 100))
->addColumn('created', 'datetime')
->addColumn('updated', 'datetime', array('null' => true))
->save();
}
== 20170829133353 MinhaMigrations: migrating
== 20170829133353 MinhaMigrations: migrated 0.0625sWhen checking in the database, just created the phinxlog table, but did not create the table corresponding to the migration.
What I did wrong ?
@rmsaitam Out of interest, do you get any different behaviour if you use ->create() instead of ->save()?
I just ran into this issue, when attempting to create a table with an invalid default value:
$table = $this->table('example');
$table->addColumn('exampledate', 'date', array('default' => '0000-00-00' ) )
->create();
Migrations appear to run successfully when running vendor/bin/phinx migrate, but the table is not created.
Just to add something that I have noticed that may or may not be the cause of others issues. I had the same problem so I just dropped the database and started over.
I remembered that I ran phinx migrate once without the ->create() method initially, then added the ->create() method, however, every time I ran phinx migrate subsequently no tables were created except the phinxlog.
So after I dropped the database and recreated it I then tested to see if that was the issue and for me it was. If I left out the ->create() method, ran phinx migrate, add the->create() method, and then ran phinx migrate again, then no migration happened.
For me the bug seems to be that you cannot leave out the ->create() method or you will have issues migrating subsequently.
I believe this is fixed in the new release, but please reopen if you still see the error
Most helpful comment
Just to add something that I have noticed that may or may not be the cause of others issues. I had the same problem so I just dropped the database and started over.
I remembered that I ran
phinx migrateonce without the->create()method initially, then added the->create()method, however, every time I ranphinx migratesubsequently no tables were created except the phinxlog.So after I dropped the database and recreated it I then tested to see if that was the issue and for me it was. If I left out the
->create()method, ranphinx migrate, add the->create()method, and then ranphinx migrateagain, then no migration happened.For me the bug seems to be that you cannot leave out the
->create()method or you will have issues migrating subsequently.