Fixed migrations
This commit is contained in:
parent
ff36c2504f
commit
be645cbd9f
|
@ -7,9 +7,6 @@ use Phinx\Migration\AbstractMigration;
|
|||
*/
|
||||
class InitialMigration extends AbstractMigration
|
||||
{
|
||||
/**
|
||||
* Migrate Up.
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
// Set up tables:
|
||||
|
@ -40,9 +37,6 @@ class InitialMigration extends AbstractMigration
|
|||
$buildMeta->save();
|
||||
}
|
||||
|
||||
/**
|
||||
* Migrate Down.
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
|
||||
|
|
|
@ -4,9 +4,6 @@ use Phinx\Migration\AbstractMigration;
|
|||
|
||||
class ChangeBuildKeysMigration extends AbstractMigration
|
||||
{
|
||||
/**
|
||||
* Migrate Up.
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$project = $this->table('project');
|
||||
|
@ -18,9 +15,6 @@ class ChangeBuildKeysMigration extends AbstractMigration
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Migrate Down.
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$project = $this->table('project');
|
||||
|
|
|
@ -4,22 +4,6 @@ use Phinx\Migration\AbstractMigration;
|
|||
|
||||
class ChooseBranch extends AbstractMigration
|
||||
{
|
||||
/**
|
||||
* Change Method.
|
||||
*
|
||||
* More information on this method is available here:
|
||||
* http://docs.phinx.org/en/latest/migrations.html#the-change-method
|
||||
*
|
||||
* Uncomment this method if you would like to use it.
|
||||
*
|
||||
public function change()
|
||||
{
|
||||
}
|
||||
*/
|
||||
|
||||
/**
|
||||
* Migrate Up.
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$project = $this->table('project');
|
||||
|
@ -28,9 +12,6 @@ class ChooseBranch extends AbstractMigration
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Migrate Down.
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$project = $this->table('project');
|
||||
|
|
|
@ -4,9 +4,6 @@ use Phinx\Migration\AbstractMigration;
|
|||
|
||||
class FixDatabaseColumns extends AbstractMigration
|
||||
{
|
||||
/**
|
||||
* Migrate Up.
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$dbAdapter = $this->getAdapter();
|
||||
|
|
|
@ -4,9 +4,6 @@ use Phinx\Migration\AbstractMigration;
|
|||
|
||||
class ArchiveProject extends AbstractMigration
|
||||
{
|
||||
/**
|
||||
* Migrate Up.
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$project = $this->table('project');
|
||||
|
@ -15,9 +12,6 @@ class ArchiveProject extends AbstractMigration
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Migrate Down.
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$project = $this->table('project');
|
||||
|
|
|
@ -5,9 +5,6 @@ use Phinx\Db\Adapter\MysqlAdapter;
|
|||
|
||||
class FixColumnTypes extends AbstractMigration
|
||||
{
|
||||
/**
|
||||
* Migrate Up.
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
// Update the build log column to MEDIUMTEXT:
|
||||
|
|
|
@ -4,9 +4,6 @@ use Phinx\Migration\AbstractMigration;
|
|||
|
||||
class UniqueEmailAndNameUserFields extends AbstractMigration
|
||||
{
|
||||
/**
|
||||
* Migrate Up.
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$user_table = $this->table('user');
|
||||
|
@ -18,9 +15,6 @@ class UniqueEmailAndNameUserFields extends AbstractMigration
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Migrate Down.
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$user_table = $this->table('user');
|
||||
|
|
|
@ -4,9 +4,13 @@ use Phinx\Migration\AbstractMigration;
|
|||
|
||||
class AddProjectGroups extends AbstractMigration
|
||||
{
|
||||
public function change()
|
||||
public function up()
|
||||
{
|
||||
$table = $this->table('project_group');
|
||||
if (!$this->hasTable('project_group')) {
|
||||
$table->create();
|
||||
}
|
||||
|
||||
if (!$table->hasColumn('title')) {
|
||||
$table->addColumn('title', 'string', ['limit' => 100, 'null' => false])->save();
|
||||
|
||||
|
@ -26,4 +30,17 @@ class AddProjectGroups extends AbstractMigration
|
|||
$table->addForeignKey('group_id', 'project_group', 'id', ['delete'=> 'RESTRICT', 'update' => 'CASCADE'])->save();
|
||||
}
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$table = $this->table('project_group');
|
||||
if ($this->hasTable('project_group')) {
|
||||
$table->drop();
|
||||
}
|
||||
|
||||
$table = $this->table('project');
|
||||
if ($table->hasColumn('group_id')) {
|
||||
$table->removeColumn('group_id');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue