Removed useless code from models + code style fixes.
This commit is contained in:
parent
508465fc74
commit
58b23fe89d
12 changed files with 85 additions and 543 deletions
|
|
@ -9,11 +9,15 @@ class AddedLanguageAndPerPageForUser extends AbstractMigration
|
|||
$table = $this->table('user');
|
||||
|
||||
if (!$table->hasColumn('language')) {
|
||||
$table->addColumn('language', 'string', ['limit' => 5, 'null' => true])->save();
|
||||
$table
|
||||
->addColumn('language', 'string', ['limit' => 5, 'null' => true])
|
||||
->save();
|
||||
}
|
||||
|
||||
if (!$table->hasColumn('per_page')) {
|
||||
$table->addColumn('per_page', 'integer', ['null' => true])->save();
|
||||
$table
|
||||
->addColumn('per_page', 'integer', ['null' => true])
|
||||
->save();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -22,11 +26,15 @@ class AddedLanguageAndPerPageForUser extends AbstractMigration
|
|||
$table = $this->table('user');
|
||||
|
||||
if ($table->hasColumn('language')) {
|
||||
$table->removeColumn('language')->save();
|
||||
$table
|
||||
->removeColumn('language')
|
||||
->save();
|
||||
}
|
||||
|
||||
if ($table->hasColumn('per_page')) {
|
||||
$table->removeColumn('per_page')->save();
|
||||
$table
|
||||
->removeColumn('per_page')
|
||||
->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,25 +13,35 @@ class AddEnvironment extends AbstractMigration
|
|||
}
|
||||
|
||||
if (!$table->hasColumn('project_id')) {
|
||||
$table->addColumn('project_id', 'integer')->save();
|
||||
$table
|
||||
->addColumn('project_id', 'integer')
|
||||
->save();
|
||||
}
|
||||
|
||||
if (!$table->hasColumn('name')) {
|
||||
$table->addColumn('name', 'string', ['limit' => 250])->save();
|
||||
$table
|
||||
->addColumn('name', 'string', ['limit' => 250])
|
||||
->save();
|
||||
}
|
||||
|
||||
if (!$table->hasColumn('branches')) {
|
||||
$table->addColumn('branches', 'text')->save();
|
||||
$table
|
||||
->addColumn('branches', 'text')
|
||||
->save();
|
||||
}
|
||||
|
||||
if (!$table->hasIndex(['project_id', 'name'])) {
|
||||
$table->addIndex(['project_id', 'name'])->save();
|
||||
$table
|
||||
->addIndex(['project_id', 'name'])
|
||||
->save();
|
||||
}
|
||||
|
||||
$table = $this->table('build');
|
||||
|
||||
if (!$table->hasColumn('environment')) {
|
||||
$table->addColumn('environment', 'string', ['limit' => 250])->save();
|
||||
$table
|
||||
->addColumn('environment', 'string', ['limit' => 250])
|
||||
->save();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -46,7 +56,9 @@ class AddEnvironment extends AbstractMigration
|
|||
$table = $this->table('build');
|
||||
|
||||
if ($table->hasColumn('environment')) {
|
||||
$table->removeColumn('environment')->save();
|
||||
$table
|
||||
->removeColumn('environment')
|
||||
->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,9 @@ class AddedTagColumnToBuildTable extends AbstractMigration
|
|||
$table = $this->table('build');
|
||||
|
||||
if (!$table->hasColumn('tag')) {
|
||||
$table->addColumn('tag', 'string', ['limit' => 250, 'null' => true])->save();
|
||||
$table
|
||||
->addColumn('tag', 'string', ['limit' => 250, 'null' => true])
|
||||
->save();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -18,7 +20,9 @@ class AddedTagColumnToBuildTable extends AbstractMigration
|
|||
$table = $this->table('build');
|
||||
|
||||
if ($table->hasColumn('tag')) {
|
||||
$table->removeColumn('tag')->save();
|
||||
$table
|
||||
->removeColumn('tag')
|
||||
->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,9 @@ class AddedRememberMeLogin extends AbstractMigration
|
|||
$table = $this->table('user');
|
||||
|
||||
if (!$table->hasColumn('remember_key')) {
|
||||
$table->addColumn('remember_key', 'string', ['limit' => 32, 'null' => true])->save();
|
||||
$table
|
||||
->addColumn('remember_key', 'string', ['limit' => 32, 'null' => true])
|
||||
->save();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -18,7 +20,9 @@ class AddedRememberMeLogin extends AbstractMigration
|
|||
$table = $this->table('user');
|
||||
|
||||
if ($table->hasColumn('remember_key')) {
|
||||
$table->removeColumn('remember_key')->save();
|
||||
$table
|
||||
->removeColumn('remember_key')
|
||||
->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,19 +6,23 @@ class AddedDefaultBranchOnly extends AbstractMigration
|
|||
{
|
||||
public function up()
|
||||
{
|
||||
$project = $this->table('project');
|
||||
$table = $this->table('project');
|
||||
|
||||
if (!$project->hasColumn('default_branch_only')) {
|
||||
$project->addColumn('default_branch_only', 'integer', ['default' => 0])->save();
|
||||
if (!$table->hasColumn('default_branch_only')) {
|
||||
$table
|
||||
->addColumn('default_branch_only', 'integer', ['default' => 0])
|
||||
->save();
|
||||
}
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$project = $this->table('project');
|
||||
$table = $this->table('project');
|
||||
|
||||
if ($project->hasColumn('default_branch_only')) {
|
||||
$project->removeColumn('default_branch_only')->save();
|
||||
if ($table->hasColumn('default_branch_only')) {
|
||||
$table
|
||||
->removeColumn('default_branch_only')
|
||||
->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue