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

28 lines
768 B
PHP

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