39 lines
989 B
PHP
39 lines
989 B
PHP
<?php
|
|
|
|
namespace App\Database\Migrations;
|
|
|
|
use CodeIgniter\Database\Migration;
|
|
|
|
class AddEnrollmentExceptionFamilyStudentIds extends Migration
|
|
{
|
|
public function up(): void
|
|
{
|
|
if (! $this->db->tableExists('enrollment_exceptions')) {
|
|
return;
|
|
}
|
|
|
|
if ($this->db->fieldExists('family_student_ids_json', 'enrollment_exceptions')) {
|
|
return;
|
|
}
|
|
|
|
$this->forge->addColumn('enrollment_exceptions', [
|
|
'family_student_ids_json' => [
|
|
'type' => 'TEXT',
|
|
'null' => true,
|
|
'after' => 'bypassed_rule_codes_json',
|
|
],
|
|
]);
|
|
}
|
|
|
|
public function down(): void
|
|
{
|
|
if (! $this->db->tableExists('enrollment_exceptions')) {
|
|
return;
|
|
}
|
|
|
|
if ($this->db->fieldExists('family_student_ids_json', 'enrollment_exceptions')) {
|
|
$this->forge->dropColumn('enrollment_exceptions', 'family_student_ids_json');
|
|
}
|
|
}
|
|
}
|