Files
alrahma_sunday_school/app/Database/Migrations/2024-11-05-000700_AddBatchNumberToReimbursements.php
root 716cc8b8d3
Tests / PHPUnit (push) Failing after 1m20s
fix school year for all tables
2026-07-18 14:45:38 -04:00

38 lines
966 B
PHP

<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
class AddBatchNumberToReimbursements extends Migration
{
public function up()
{
if (! $this->db->tableExists('reimbursements') || $this->db->fieldExists('batch_number', 'reimbursements')) {
return;
}
$fields = [
'batch_number' => [
'type' => 'INT',
'constraint' => 11,
'unsigned' => true,
'default' => 0,
'null' => false,
'after' => 'reimbursement_method',
],
];
$this->forge->addColumn('reimbursements', $fields);
}
public function down()
{
if (! $this->db->tableExists('reimbursements') || ! $this->db->fieldExists('batch_number', 'reimbursements')) {
return;
}
$this->forge->dropColumn('reimbursements', 'batch_number');
}
}