recreate project
This commit is contained in:
+36
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\Database\Migrations;
|
||||
|
||||
use CodeIgniter\Database\Migration;
|
||||
|
||||
class AddQuestionCountToCompetitionClassWinners extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$db = \Config\Database::connect();
|
||||
if (!$db->tableExists('competition_class_winners')) {
|
||||
return;
|
||||
}
|
||||
if ($db->fieldExists('question_count', 'competition_class_winners')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->forge->addColumn('competition_class_winners', [
|
||||
'question_count' => ['type' => 'INT', 'constraint' => 11, 'null' => true],
|
||||
]);
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$db = \Config\Database::connect();
|
||||
if (!$db->tableExists('competition_class_winners')) {
|
||||
return;
|
||||
}
|
||||
if (!$db->fieldExists('question_count', 'competition_class_winners')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->forge->dropColumn('competition_class_winners', 'question_count');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user