clqms-be/app/Database/Migrations/2025-12-01-100001_AreaGeo.php
2025-12-01 16:47:52 +07:00

24 lines
732 B
PHP

<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
class CreateAreaGeoTable extends Migration {
public function up() {
$this->forge->addField([
'AreaGeoID' => ['type' => 'INT', 'constraint' => 11, 'unsigned' => true, 'auto_increment' => true],
'AreaCode' => ['type' => 'varchar', 'constraint' => 20, 'null' => true],
'Class' => ['type' => 'int', 'null' => true],
'AreaName' => ['type' => 'VARCHAR', 'constraint' => 100, 'null' => false],
'Parent' => ['type' => 'int', 'null' => true],
]);
$this->forge->addKey('AreaGeoID', true);
$this->forge->createTable('areageo');
}
public function down() {
$this->forge->dropTable('areageo');
}
}