php-censor/src/Migrations/20180311165225_removed_last_commit_from_project.php

33 lines
786 B
PHP

<?php
use Phinx\Migration\AbstractMigration;
class RemovedLastCommitFromProject extends AbstractMigration
{
public function up()
{
if ($this->hasTable('project')) {
$table = $this->table('project');
if ($table->hasColumn('last_commit')) {
$table
->removeColumn('last_commit')
->save();
}
}
}
public function down()
{
if ($this->hasTable('project')) {
$table = $this->table('project');
if (!$table->hasColumn('last_commit')) {
$table
->addColumn('last_commit', 'string', ['limit' => 250, 'null' => true, 'default' => null])
->save();
}
}
}
}