AMS_Backend/app/Database/Migrations/2025-11-05-031045_CreatePosition.php
2025-11-06 13:41:06 +08:00

29 lines
840 B
PHP

<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
class CreatePosition extends Migration
{
public function up()
{
$this->forge->addField([
'position_id' => ['type' => 'INT', 'unsigned' => true, 'auto_increment' => true],
'position_name' => ['type' => 'VARCHAR', 'constraint' => 255],
'permission' => ['type' => 'TEXT', 'null' => true],
'created_at' => ['type' => 'DATETIME', 'null' => true],
'updated_at' => ['type' => 'DATETIME', 'null' => true],
'deleted_at' => ['type' => 'DATETIME', 'null' => true],
]);
$this->forge->addKey('position_id', true);
$this->forge->createTable('position');
}
public function down()
{
$this->forge->dropTable('position');
}
}