recreate project

This commit is contained in:
root
2026-02-10 22:11:06 -05:00
commit 663c0cdbda
10149 changed files with 1379710 additions and 0 deletions
@@ -0,0 +1,74 @@
<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
class CreatePrintRequests extends Migration
{
public function up()
{
$this->forge->addField([
'id' => [
'type' => 'INT',
'constraint' => 11,
'unsigned' => true,
'auto_increment' => true,
],
'teacher_id' => [
'type' => 'INT',
'constraint' => 11,
'unsigned' => true,
],
'admin_id' => [
'type' => 'INT',
'constraint' => 11,
'unsigned' => true,
'null' => true,
],
'class_id' => [
'type' => 'INT',
'constraint' => 11,
'unsigned' => true,
],
'file_path' => [
'type' => 'VARCHAR',
'constraint' => '255',
],
'num_copies' => [
'type' => 'INT',
'constraint' => 11,
],
'required_by' => [
'type' => 'DATETIME',
],
'pickup_method' => [
'type' => 'VARCHAR',
'constraint' => '255',
],
'status' => [
'type' => 'ENUM',
'constraint' => ['not_assigned', 'assigned', 'done', 'delivered'],
'default' => 'not_assigned',
],
'created_at' => [
'type' => 'DATETIME',
'null' => true,
],
'updated_at' => [
'type' => 'DATETIME',
'null' => true,
],
]);
$this->forge->addKey('id', true);
$this->forge->addForeignKey('teacher_id', 'users', 'id', 'CASCADE', 'CASCADE');
$this->forge->addForeignKey('admin_id', 'users', 'id', 'CASCADE', 'SET NULL');
$this->forge->addForeignKey('class_id', 'classes', 'id', 'CASCADE', 'CASCADE');
$this->forge->createTable('print_requests');
}
public function down()
{
$this->forge->dropTable('print_requests');
}
}