I've created the following migration. It works the first time I run it, but if I make changes to the migration - such as adding a new column - when I run phinx mingrate -c src/phinx-config.php
it doesn't update the database.
It appears to do nothing. If I delete the entry from phinxlog
in the database, and remove the user
table it will recreate the table. Otherwise, no changes are made.
If I delete the entry from phinxlog
and don't delete the table, I get an error that the user
table already exists. I though this was the purpose for down()
so it can drop the table?
Here's my code:
<?php
use \StudentApp\Migrations\Migration;
class AppMigration extends Migration
{
public function up()
{
$this->schema->create('users', function(Illuminate\Database\Schema\Blueprint $table) {
$table->increments('id');
$table->string('firstname');
$table->string('lastname');
$table->string('email');
$table->string('password');
$table->string('token');
$table->timestamp('token_expiry');
$table->timestamps();
});
}
public function down()
{
$this->schema->drop('users');
}
}
Any ideas why the database isn't being updated when I rerun migrate
?