29 lines
885 B
PHP
29 lines
885 B
PHP
<?php
|
|
|
|
namespace App\Database\Migrations;
|
|
|
|
use CodeIgniter\Database\Migration;
|
|
|
|
class CreateProductImei extends Migration
|
|
{
|
|
public function up()
|
|
{
|
|
$this->forge->addField([
|
|
'product_imei_id' => ['type' => 'INT', 'unsigned' => true, 'auto_increment' => true],
|
|
'aging_days' => ['type' => 'INT', 'null' => true],
|
|
'profit' => ['type' => 'DECIMAL', 'constraint' => '10,2', 'null' => true],
|
|
'created_at' => ['type' => 'DATETIME', 'null' => true],
|
|
'updated_at' => ['type' => 'DATETIME', 'null' => true],
|
|
'deleted_at' => ['type' => 'DATETIME', 'null' => true],
|
|
]);
|
|
$this->forge->addKey('product_imei_id', true);
|
|
$this->forge->createTable('product_imei');
|
|
}
|
|
|
|
|
|
public function down()
|
|
{
|
|
$this->forge->dropTable('product_imei');
|
|
}
|
|
}
|