Files
alrahma_sunday_school/app/Database/Migrations/2026-01-26-000100_CreateTeacherSubmissionNotificationHistory.php
2026-02-10 22:11:06 -05:00

73 lines
2.0 KiB
PHP

<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
class CreateTeacherSubmissionNotificationHistory extends Migration
{
public function up()
{
$this->forge->addField([
'id' => [
'type' => 'INT',
'unsigned' => true,
'auto_increment' => true,
],
'teacher_id' => [
'type' => 'INT',
'unsigned' => true,
'null' => false,
],
'class_section_id' => [
'type' => 'INT',
'unsigned' => true,
'null' => false,
],
'admin_id' => [
'type' => 'INT',
'unsigned' => true,
'null' => false,
],
'notification_category' => [
'type' => 'VARCHAR',
'constraint' => 64,
'default' => 'teacher_submissions',
],
'message' => [
'type' => 'TEXT',
'null' => true,
],
'status' => [
'type' => 'VARCHAR',
'constraint' => 32,
'default' => 'sent',
],
'school_year' => [
'type' => 'VARCHAR',
'constraint' => 32,
'null' => true,
],
'semester' => [
'type' => 'VARCHAR',
'constraint' => 32,
'null' => true,
],
'sent_at' => [
'type' => 'DATETIME',
'null' => false,
'default' => 'CURRENT_TIMESTAMP',
],
]);
$this->forge->addKey('id', true);
$this->forge->addKey(['teacher_id', 'class_section_id']);
$this->forge->createTable('teacher_submission_notification_history');
}
public function down()
{
$this->forge->dropTable('teacher_submission_notification_history');
}
}