Files
alrahma_sunday_school/app/Database/Migrations/2026-07-19-000700_CreateReimbursementReversals.php
T
root a30c1398a1
Tests / PHPUnit (push) Failing after 1m21s
fix financials
2026-07-18 22:57:40 -04:00

36 lines
1.2 KiB
PHP

<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
class CreateReimbursementReversals extends Migration
{
public function up()
{
if ($this->db->tableExists('reimbursement_reversals')) {
return;
}
$this->forge->addField([
'id' => ['type' => 'INT', 'constraint' => 11, 'unsigned' => true, 'auto_increment' => true],
'reimbursement_id' => ['type' => 'INT', 'constraint' => 11, 'unsigned' => true, 'null' => false],
'amount_cents' => ['type' => 'INT', 'constraint' => 11, 'null' => false],
'reason' => ['type' => 'TEXT', 'null' => false],
'reversed_by' => ['type' => 'INT', 'constraint' => 11, 'unsigned' => true, 'null' => true],
'reversed_at' => ['type' => 'DATETIME', 'null' => false],
'created_at' => ['type' => 'DATETIME', 'null' => false],
]);
$this->forge->addKey('id', true);
$this->forge->addKey('reimbursement_id');
$this->forge->createTable('reimbursement_reversals', true);
}
public function down()
{
if ($this->db->tableExists('reimbursement_reversals')) {
$this->forge->dropTable('reimbursement_reversals', true);
}
}
}