raspisms/db/migrations/20200303183903_add_id_phone...

19 lines
496 B
PHP
Raw Permalink Normal View History

<?php
use Phinx\Migration\AbstractMigration;
class AddIdPhoneScheduled extends AbstractMigration
{
/**
* Add column id_phone in scheduled and remove origin
*/
public function change()
{
$table = $this->table('scheduled');
$table->removeColumn('origin')
->addColumn('id_phone', 'integer', ['null' => True])
->addForeignKey('id_phone', 'phone', 'id', ['delete'=> 'SET_NULL', 'update'=> 'CASCADE'])
->save();
}
}