2025-10-22 13:30:43 +07:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Database\Migrations;
|
|
|
|
|
|
|
|
|
|
use CodeIgniter\Database\Migration;
|
|
|
|
|
|
2025-10-29 11:08:38 +07:00
|
|
|
class CreateRefRangesTable extends Migration {
|
2025-10-22 13:30:43 +07:00
|
|
|
public function up() {
|
|
|
|
|
|
|
|
|
|
$this->forge->addField([
|
|
|
|
|
'RefNumID' => ['type' => 'INT', 'auto_increment' => true, 'unsigned' => true],
|
|
|
|
|
'SiteID' => ['type' => 'INT', 'null' => true],
|
|
|
|
|
'TestSiteID' => ['type' => 'INT', 'null' => false],
|
2025-12-29 08:23:48 +07:00
|
|
|
'SpcType' => ['type' => 'INT', 'null' => true],
|
2025-10-22 13:30:43 +07:00
|
|
|
'Sex' => ['type' => 'INT', 'null' => true],
|
2025-12-03 15:45:24 +07:00
|
|
|
'Criteria' => ['type' => 'varchar', 'constraint'=>100, 'null' => true],
|
2025-10-22 13:30:43 +07:00
|
|
|
'AgeStart' => ['type' => 'INT', 'null' => true],
|
|
|
|
|
'AgeEnd' => ['type' => 'int', 'null' => true],
|
2025-12-29 08:23:48 +07:00
|
|
|
'NumRefType' => ['type' => 'INT', 'null' => true],
|
|
|
|
|
'RangeType' => ['type' => 'INT', 'null' => true],
|
|
|
|
|
'LowSign' => ['type' => 'INT', 'null' => true],
|
|
|
|
|
'Low' => ['type' => 'INT', 'null' => true],
|
|
|
|
|
'HighSign' => ['type' => 'INT', 'null' => true],
|
|
|
|
|
'High' => ['type' => 'INT', 'null' => true],
|
|
|
|
|
'Display' => ['type' => 'INT', 'null' => true],
|
|
|
|
|
'Flag' => ['type' => 'varchar', 'constraint'=>10, 'null' => true],
|
|
|
|
|
'Interpretation' => ['type' => 'varchar', 'constraint'=>255, 'null' => true],
|
|
|
|
|
'Notes' => ['type' => 'varchar', 'constraint'=>255, 'null' => true],
|
2025-10-22 13:30:43 +07:00
|
|
|
'CreateDate' => ['type' => 'Datetime', 'null' => true],
|
2025-12-29 08:23:48 +07:00
|
|
|
'StartDate' => ['type' => 'Datetime', 'null' => true],
|
2025-10-22 13:30:43 +07:00
|
|
|
'EndDate' => ['type' => 'Datetime', 'null' => true],
|
|
|
|
|
]);
|
|
|
|
|
$this->forge->addKey('RefNumID', true);
|
|
|
|
|
$this->forge->createTable('refnum');
|
|
|
|
|
|
2025-12-03 15:45:24 +07:00
|
|
|
$this->forge->addField([
|
|
|
|
|
'RefTxtID' => ['type' => 'INT', 'auto_increment' => true, 'unsigned' => true],
|
|
|
|
|
'SiteID' => ['type' => 'INT', 'null' => true],
|
|
|
|
|
'TestSiteID' => ['type' => 'INT', 'null' => false],
|
|
|
|
|
'SpcType' => ['type' => 'varchar', 'constraint'=> 10, 'null' => false],
|
|
|
|
|
'Sex' => ['type' => 'INT', 'null' => true],
|
2025-12-29 08:23:48 +07:00
|
|
|
'Criteria' => ['type' => 'varchar', 'constraint'=>100, 'null' => true],
|
2025-12-03 15:45:24 +07:00
|
|
|
'AgeStart' => ['type' => 'INT', 'null' => true],
|
|
|
|
|
'AgeEnd' => ['type' => 'int', 'null' => true],
|
2025-12-29 08:23:48 +07:00
|
|
|
'TxtRefType' => ['type' => 'INT', 'null' => true],
|
2025-12-03 15:45:24 +07:00
|
|
|
'RefTxt' => ['type' => 'varchar', 'constraint'=>255, 'null' => true],
|
2025-12-29 08:23:48 +07:00
|
|
|
'Flag' => ['type' => 'varchar', 'constraint'=>10, 'null' => true],
|
|
|
|
|
'Notes' => ['type' => 'varchar', 'constraint'=>255, 'null' => true],
|
2025-12-03 15:45:24 +07:00
|
|
|
'CreateDate' => ['type' => 'Datetime', 'null' => true],
|
2025-12-29 08:23:48 +07:00
|
|
|
'StartDate' => ['type' => 'Datetime', 'null' => true],
|
2025-12-03 15:45:24 +07:00
|
|
|
'EndDate' => ['type' => 'Datetime', 'null' => true],
|
|
|
|
|
]);
|
|
|
|
|
$this->forge->addKey('RefTxtID', true);
|
|
|
|
|
$this->forge->createTable('reftxt');
|
2025-10-22 13:30:43 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function down() {
|
|
|
|
|
$this->forge->dropTable('refnum');
|
2025-12-03 15:45:24 +07:00
|
|
|
$this->forge->dropTable('reftxt');
|
2025-10-22 13:30:43 +07:00
|
|
|
}
|
|
|
|
|
}
|