clqms-be/app/Database/Migrations/2025-10-22-100001_Zones_CRM.php

25 lines
814 B
PHP

<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
class CreateZonessTable extends Migration {
public function up() {
$this->forge->addField([
'zoneid' => ['type' => 'INT', 'constraint' => 11, 'unsigned' => true, 'auto_increment' => true],
'parentzoneid' => ['type' => 'INT', 'constraint' => 11, 'unsigned' => true, 'null' => true],
'zonecode' => ['type' => 'VARCHAR', 'constraint' => 10, 'null' => false],
'zoneclass' => ['type' => 'VARCHAR', 'constraint' => 5, 'null' => false],
'zonename' => ['type' => 'VARCHAR', 'constraint' => 100, 'null' => false],
]);
$this->forge->addKey('zoneid', true);
$this->forge->createTable('zones');
}
public function down() {
$this->forge->dropTable('zones');
}
}