clqms-be/app/Database/Migrations/2026-02-26-090320_AddTestSiteIDToTestmap.php
mahdahar 5e0a7f21f5 feat: add TestMapDetail controller, model and migration for test site mapping
- 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
2026-02-26 16:48:10 +07:00

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');
}
}