clqms-be/app/Database/Migrations/2025-09-11-130122_Coded_Text.php
2025-09-11 16:40:36 +07:00

41 lines
1.5 KiB
PHP

<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
class CreateCodedTextTable extends Migration {
public function up() {
$this->forge->addField([
'CTID' => ['type' => 'INT', 'auto_increment' => true, 'unsigned' => true],
'SiteID' => ['type' => 'INT', 'null' => true],
'CTGroup' => ['type' => 'INT', 'null' => true],
'CT' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => false],
'Description' => ['type' => 'varchar', 'constraint' => 255, 'null' => true],
'FontStyle' => ['type' => 'int', 'null' => true],
'Category' => ['type' => 'int', 'null' => true],
'CreateDate' => ['type' => 'DATETIME', 'null' => true],
'EndDate' => ['type' => 'DATETIME', 'null' => true]
]);
$this->forge->addKey('CTID', true);
$this->forge->createTable('codedtxt');
$this->forge->addField([
'CTFldID' => ['type' => 'INT', 'auto_increment' => true, 'unsigned' => true],
'SiteID' => ['type' => 'INT', 'null' => true],
'TblName' => ['type' => 'Varchar', 'constraint' => 255, 'null' => true],
'FldName' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => false],
'CTGroup' => ['type' => 'INT', 'null' => true],
'CreateDate' => ['type' => 'DATETIME', 'null' => true],
'EndDate' => ['type' => 'DATETIME', 'null' => true]
]);
$this->forge->addKey('CTFldID', true);
$this->forge->createTable('codedtxtfld');
}
public function down() {
$this->forge->dropTable('codedtxt');
$this->forge->dropTable('codedtxtfld');
}
}