clqms-be/app/Database/Migrations/2025-12-29-150000_EdgeRes.php
mahdahar cb4181dbff refactor: restructure application architecture and consolidate controllers
- Consolidate page controllers into unified PagesController
- Remove deprecated V2 pages, layouts, and controllers (AuthPage, DashboardPage, V2Page)
- Add Edge resource with migration and model (EdgeResModel)
- Implement new main_layout.php for consistent page structure
- Reorganize patient views into dedicated module with dialog form
- Update routing configuration in Routes.php
- Enhance AuthFilter for improved authentication handling
- Clean up unused V2 assets (CSS, JS) and legacy images
- Update README.md with latest project information

This refactoring improves code organization, removes technical debt, and
establishes a cleaner foundation for future development.
2025-12-29 16:57:46 +07:00

59 lines
2.5 KiB
PHP

<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
class CreateEdgeResTables extends Migration {
public function up() {
// Main edgeres table - staging for instrument results
$this->forge->addField([
'EdgeResID' => ['type' => 'INT', 'auto_increment' => true],
'SiteID' => ['type' => 'INT', 'null' => true],
'InstrumentID' => ['type' => 'varchar', 'constraint' => 100, 'null' => true],
'SampleID' => ['type' => 'varchar', 'constraint' => 30, 'null' => true],
'PatientID' => ['type' => 'varchar', 'constraint' => 50, 'null' => true],
'Payload' => ['type' => 'TEXT', 'null' => true],
'Status' => ['type' => 'varchar', 'constraint' => 20, 'default' => 'pending'],
'AutoProcess' => ['type' => 'TINYINT', 'default' => 0, 'null' => true],
'ProcessedAt' => ['type' => 'DATETIME', 'null' => true],
'ErrorMessage' => ['type' => 'TEXT', 'null' => true],
'CreateDate' => ['type' => 'DATETIME', 'null' => true],
'EndDate' => ['type' => 'DATETIME', 'null' => true],
'ArchiveDate' => ['type' => 'DATETIME', 'null' => true],
'DelDate' => ['type' => 'DATETIME', 'null' => true],
]);
$this->forge->addPrimaryKey('EdgeResID');
$this->forge->createTable('edgeres');
// Edge status log - for instrument status tracking
$this->forge->addField([
'EdgeStatusID' => ['type' => 'INT', 'auto_increment' => true],
'InstrumentID' => ['type' => 'varchar', 'constraint' => 100, 'null' => true],
'Status' => ['type' => 'varchar', 'constraint' => 50, 'null' => true],
'LastActivity' => ['type' => 'DATETIME', 'null' => true],
'Timestamp' => ['type' => 'DATETIME', 'null' => true],
'CreateDate' => ['type' => 'DATETIME', 'null' => true],
]);
$this->forge->addPrimaryKey('EdgeStatusID');
$this->forge->createTable('edgestatus');
// Edge order acknowledgment log
$this->forge->addField([
'EdgeAckID' => ['type' => 'INT', 'auto_increment' => true],
'OrderID' => ['type' => 'INT', 'null' => true],
'InstrumentID' => ['type' => 'varchar', 'constraint' => 100, 'null' => true],
'AckDate' => ['type' => 'DATETIME', 'null' => true],
'CreateDate' => ['type' => 'DATETIME', 'null' => true],
]);
$this->forge->addPrimaryKey('EdgeAckID');
$this->forge->createTable('edgeack');
}
public function down() {
$this->forge->dropTable('edgeack', true);
$this->forge->dropTable('edgestatus', true);
$this->forge->dropTable('edgeres', true);
}
}