29 lines
840 B
PHP
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');
|
|
}
|
|
}
|