ria/app/Database/Migrations/2024-10-03-042354_CreateFactoryMachineMasterTable.php
2024-10-03 18:01:09 +05:30

35 lines
987 B
PHP

<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
class CreateFactoryMachineMasterTable extends Migration
{
public function up()
{
$this->forge->addField([
'id' => ['type' => 'INT', 'auto_increment' => true],
'machine_name' => ['type' => 'VARCHAR', 'constraint' => '255'],
'machine_type' => ['type' => 'VARCHAR', 'constraint' => '255'],
'fuel_type' => ['type' => 'VARCHAR', 'constraint' => '255'],
'is_active' => ['type' => 'TINYINT', 'constraint' => 1, 'default' => 1],
'created_at' => ['type' => 'DATETIME', 'null' => true],
'updated_at' => ['type' => 'DATETIME', 'null' => true]
]);
$this->forge->addKey('id', true);
$this->forge->createTable('t_factoryMachineMaster');
}
public function down()
{
$this->forge->dropTable('t_factoryMachineMaster');
}
}