forge->addField([ 'ResultID' => ['type' => 'INT', 'auto_increment' => true], 'SiteID' => ['type' => 'INT', 'null' => true], 'OrderID' => ['type' => 'INT', 'null' => true], 'InternalSID' => ['type' => 'INT', 'null' => true], 'SID' => ['type' => 'varchar', 'constraint' => 30], 'SampleID' => ['type' => 'varchar', 'constraint' => 30], 'TestSiteID' => ['type' => 'INT', 'null' => true], 'TestSiteCode' => ['type' => 'CHAR', 'constraint' => 6, 'null' => true], 'AspCnt' => ['type' => 'INT', 'default' => 1, 'null' => true], 'Result' => ['type' => 'varchar', 'constraint' => 255, 'null' => true], 'SampleType' => ['type' => 'varchar', 'constraint' => 50, 'null' => true], 'ResultDateTime' => ['type' => 'DATETIME'], 'WorkstationID' => ['type' => 'INT', 'null' => true], 'EquipmentID' => ['type' => 'INT', 'null' => true], 'RefNumID' => ['type' => 'INT', 'null' => true], 'RefTHoldID' => ['type' => 'INT', 'null' => true], 'RefVSetID' => ['type' => 'INT', 'null' => true], 'RefTxtID' => ['type' => 'INT', '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('ResultID'); $this->forge->createTable('patres'); $this->forge->addField([ 'ResFlagID' => ['type' => 'INT', 'auto_increment' => true], 'ResultID' => ['type' => 'INT', 'null' => false], 'Flag' => ['type' => 'varchar', 'constraint' => 50, '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('ResFlagID'); $this->forge->createTable('patresflag'); $this->forge->addField([ 'ResStatusID' => ['type' => 'INT', 'auto_increment' => true], 'ResultID' => ['type' => 'INT', 'null' => false], 'SID' => ['type' => 'varchar', 'constraint' => 30], 'TestAct' => ['type' => 'varchar', 'constraint' => 255], 'ActRes' => ['type' => 'INT', 'null' => true], 'TestStatus' => ['type' => 'INT', 'null' => true], 'CurrSiteID' => ['type' => 'INT', 'null' => true], 'CurrLocID' => ['type' => 'INT', 'null' => true], 'Origin' => ['type' => 'varchar', 'constraint' => 255, 'null' => true], 'GeoLocationSystem' => ['type' => 'varchar', 'constraint' => 255, 'null' => true], 'GeoLocationData' => ['type' => 'TEXT', 'null' => true], 'DIDType' => ['type' => 'varchar', 'constraint' => 255, 'null' => true], 'DID' => ['type' => 'varchar', 'constraint' => 255, 'null' => true], 'UserID' => ['type' => 'varchar', 'constraint' => 255, 'null' => true], 'LogDate' => ['type' => 'DATETIME', 'null' => true], 'EndDate' => ['type' => 'DATETIME', 'null' => true], 'ArchiveDate' => ['type' => 'DATETIME', 'null' => true], ]); $this->forge->addPrimaryKey('ResStatusID'); $this->forge->createTable('patrestatus'); } public function down() { $this->forge->dropTable('patrestatus'); $this->forge->dropTable('patresflag'); $this->forge->dropTable('patres'); } }