init backend presensi

This commit is contained in:
mwpn
2026-03-05 14:37:36 +07:00
commit b4fda6b9c9
319 changed files with 27261 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
class AddLessonSlotIdAndUniqueToSchedulesTable extends Migration
{
public function up()
{
$this->forge->addColumn('schedules', [
'lesson_slot_id' => [
'type' => 'INT',
'constraint' => 11,
'unsigned' => true,
'null' => true,
'after' => 'teacher_user_id',
],
'is_active' => [
'type' => 'TINYINT',
'constraint' => 1,
'default' => 1,
'after' => 'room',
],
]);
$this->forge->addForeignKey('lesson_slot_id', 'lesson_slots', 'id', 'SET NULL', 'CASCADE', 'schedules_lesson_slot_id_fk');
$this->forge->addUniqueKey(['class_id', 'lesson_slot_id', 'day_of_week'], 'schedules_class_slot_day_unique');
}
public function down()
{
$this->forge->dropForeignKey('schedules', 'schedules_lesson_slot_id_fk');
$this->forge->dropKey('schedules', 'schedules_class_slot_day_unique');
$this->forge->dropColumn('schedules', 'lesson_slot_id');
$this->forge->dropColumn('schedules', 'is_active');
}
}