This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Database\Migrations;
|
||||
|
||||
use CodeIgniter\Database\Migration;
|
||||
|
||||
class AddFallMakeupExamToSchoolYears extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
if (! $this->db->tableExists('school_years') || $this->db->fieldExists('fall_makeup_exam_on', 'school_years')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->forge->addColumn('school_years', [
|
||||
'fall_makeup_exam_on' => [
|
||||
'type' => 'DATE',
|
||||
'null' => true,
|
||||
'after' => 'registration_ends_on',
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
if (! $this->db->tableExists('school_years') || ! $this->db->fieldExists('fall_makeup_exam_on', 'school_years')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->forge->dropColumn('school_years', 'fall_makeup_exam_on');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user