Files
alrahma_sunday_school/app/Database/Migrations/2026-08-24-120000_RemoveRegistrationAndMandatoryFees.php
root 608aca79b8
Deploy to Shared Hosting / Shared hosting deploy (push) Failing after 47s
Tests / PHPUnit (push) Failing after 1m19s
fix enrollment, invoice, payment and financila aid
2026-08-24 21:20:58 -04:00

51 lines
1.4 KiB
PHP

<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
class RemoveRegistrationAndMandatoryFees extends Migration
{
public function up()
{
if (! $this->db->tableExists('school_years')) {
return;
}
foreach (['registration_fee', 'mandatory_fees'] as $column) {
if ($this->db->fieldExists($column, 'school_years')) {
$this->forge->dropColumn('school_years', $column);
}
}
}
public function down()
{
if (! $this->db->tableExists('school_years')) {
return;
}
if (! $this->db->fieldExists('registration_fee', 'school_years')) {
$this->forge->addColumn('school_years', [
'registration_fee' => [
'type' => 'DECIMAL',
'constraint' => '10,2',
'default' => 0,
'after' => 'adult_student_registration_enabled',
],
]);
}
if (! $this->db->fieldExists('mandatory_fees', 'school_years')) {
$this->forge->addColumn('school_years', [
'mandatory_fees' => [
'type' => 'DECIMAL',
'constraint' => '10,2',
'default' => 0,
'after' => 'tuition_due_at_registration',
],
]);
}
}
}