Files
alrahma_sunday_school/app/Database/Migrations/2026-02-04-000420_CreatePlacementBatches.php
T
2026-02-10 22:11:06 -05:00

35 lines
1.1 KiB
PHP

<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
class CreatePlacementBatches extends Migration
{
public function up()
{
if ($this->db->tableExists('placement_batches')) {
return;
}
$this->forge->addField([
'id' => ['type' => 'INT', 'constraint' => 11, 'unsigned' => true, 'auto_increment' => true],
'placement_test' => ['type' => 'VARCHAR', 'constraint' => 30],
'school_year' => ['type' => 'VARCHAR', 'constraint' => 20],
'created_by' => ['type' => 'INT', 'constraint' => 11, 'unsigned' => true, 'null' => true],
'updated_by' => ['type' => 'INT', 'constraint' => 11, 'unsigned' => true, 'null' => true],
'created_at' => ['type' => 'DATETIME', 'null' => true],
'updated_at' => ['type' => 'DATETIME', 'null' => true],
]);
$this->forge->addKey('id', true);
$this->forge->addKey(['placement_test', 'school_year']);
$this->forge->createTable('placement_batches');
}
public function down()
{
$this->forge->dropTable('placement_batches', true);
}
}