33 lines
840 B
PHP
33 lines
840 B
PHP
<?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');
|
|
}
|
|
}
|