I have this migrations but
<?php
use Phinx\Migration\AbstractMigration;
class DriverPeakTimes extends AbstractMigration
{
public function up()
{ $table = $this->table('peak_times');
$table->addColumn('from_time', 'time')
->addColumn('to_time', 'time')
->addColumn('weekday', 'integer')
->addColumn('zone_id', 'integer')
->save();
}
public function down()
{
if ($this -> table('peak_times')->exists() -> drop() -> save());
}
}
Getting an error:
SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'from_time'
When I made this migrations on my development database it worked, there were no problems, but when it came to migrating my production database it is failing to migrate, I do not know the root cause of this problem, because I do not have duplicate columns in my migration moreover I do not have such table and its columns in my database.
Versions of tools I am using to make my migrations:
- php - 5.6.40
- composer - 1.6.3
- phinx - Phinx by CakePHP - https://phinx.org. 0.9.2