Files
alrahma_sunday_school/app/Database/Migrations/2026-01-27-211500_AddIsLegacyToExamDrafts.php
2026-08-15 15:07:16 -04:00

32 lines
710 B
PHP

<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
class AddIsLegacyToExamDrafts extends Migration
{
public function up()
{
if ($this->db->fieldExists('is_legacy', 'exam_drafts')) {
return;
}
$this->forge->addColumn('exam_drafts', [
'is_legacy' => [
'type' => 'TINYINT',
'constraint' => 1,
'default' => 0,
'after' => 'admin_id',
],
]);
}
public function down()
{
if ($this->db->fieldExists('is_legacy', 'exam_drafts')) {
$this->forge->dropColumn('exam_drafts', 'is_legacy');
}
}
}