devsofttech_hms_ci4/app/Database/Migrations/2026-03-18-000028_CreateCityAutoUTable.php
DevSoftTech Server 1856d990eb fix: add city_auto_u migration and fix HospitalProfile upload mkdir error
- Add migration 2026-03-18-000028_CreateCityAutoUTable.php to create
  the missing city_auto_u table (city, district, state columns) used
  by PatientModel::getCitySuggestions() — resolves 500 on /billing/patient/city

- Fix HospitalProfile::save() to check directory creation success before
  moving uploaded logo files; returns clean JSON error instead of
  throwing HTTPException when public/assets/images/ is not writable
2026-03-18 06:01:01 +05:30

45 lines
1.1 KiB
PHP

<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
class CreateCityAutoUTable extends Migration
{
public function up(): void
{
$this->forge->addField([
'id' => [
'type' => 'INT',
'unsigned' => true,
'auto_increment' => true,
],
'city' => [
'type' => 'VARCHAR',
'constraint' => 150,
'default' => '',
],
'district' => [
'type' => 'VARCHAR',
'constraint' => 150,
'default' => '',
],
'state' => [
'type' => 'VARCHAR',
'constraint' => 100,
'default' => '',
],
]);
$this->forge->addKey('id', true);
$this->forge->addKey(['city', 'district', 'state']);
$this->forge->createTable('city_auto_u', true);
}
public function down(): void
{
$this->forge->dropTable('city_auto_u', true);
}
}