- Add TestMapDetailController for managing test mapping details - Create TestMapDetailModel with CRUD operations - Add migration for TestSiteID column in testmap table - Update TestMapController and TestMapModel - Update routes, seeder and PatVisitModel - Regenerate API documentation bundle
30 lines
745 B
PHP
30 lines
745 B
PHP
<?php
|
|
|
|
namespace App\Database\Migrations;
|
|
|
|
use CodeIgniter\Database\Migration;
|
|
|
|
class AddTestSiteIDToTestmap extends Migration
|
|
{
|
|
public function up()
|
|
{
|
|
$this->forge->addColumn('testmap', [
|
|
'TestSiteID' => [
|
|
'type' => 'INT',
|
|
'unsigned' => true,
|
|
'null' => true,
|
|
'after' => 'TestMapID'
|
|
]
|
|
]);
|
|
|
|
// Add foreign key if it doesn't exist
|
|
$this->forge->addForeignKey('TestSiteID', 'testdefsite', 'TestSiteID', 'CASCADE', 'CASCADE');
|
|
}
|
|
|
|
public function down()
|
|
{
|
|
$this->forge->dropForeignKey('testmap', 'testmap_TestSiteID_foreign');
|
|
$this->forge->dropColumn('testmap', 'TestSiteID');
|
|
}
|
|
}
|