Files
alrahma_sunday_school/app/Database/Migrations/2026-08-14-000500_AddEnrollmentExceptionFamilyStudentIds.php
2026-08-15 15:07:16 -04:00

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');
}
}
}