fix invoice and enrollment fees
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Database\Migrations;
|
||||
|
||||
use CodeIgniter\Database\Migration;
|
||||
|
||||
final class AddTuitionFeeToInvoiceStudentsList extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
if (! $this->db->tableExists('invoice_students_list')
|
||||
|| $this->db->fieldExists('tuition_fee', 'invoice_students_list')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->forge->addColumn('invoice_students_list', [
|
||||
'tuition_fee' => [
|
||||
'type' => 'DECIMAL',
|
||||
'constraint' => '10,2',
|
||||
'null' => false,
|
||||
'default' => '0.00',
|
||||
'after' => 'enrolled',
|
||||
],
|
||||
]);
|
||||
$this->db->resetDataCache();
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
if ($this->db->tableExists('invoice_students_list')
|
||||
&& $this->db->fieldExists('tuition_fee', 'invoice_students_list')) {
|
||||
$this->forge->dropColumn('invoice_students_list', 'tuition_fee');
|
||||
$this->db->resetDataCache();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user