You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
1.4 KiB
PHTML
56 lines
1.4 KiB
PHTML
8 months ago
|
<?php
|
||
|
|
||
|
namespace App\Database\Migrations;
|
||
|
|
||
|
use CodeIgniter\Database\Migration;
|
||
|
|
||
|
class CreatePayrollGroup extends Migration
|
||
|
{
|
||
|
public function up()
|
||
|
{
|
||
|
$this->forge->addField([
|
||
|
'pay_group_id' => [
|
||
|
'type' => 'INT',
|
||
|
'constraint' => 11,
|
||
|
'unsigned' => true,
|
||
|
'auto_increment' => true,
|
||
|
],
|
||
|
'pay_group_name' => [
|
||
|
'type' => 'VARCHAR',
|
||
|
'constraint' => 255,
|
||
|
],
|
||
|
|
||
|
// Common fields
|
||
|
'created_at' => [
|
||
|
'type' => 'DATETIME',
|
||
|
'null' => true,
|
||
|
],
|
||
|
'created_by' => [
|
||
|
'type' => 'VARCHAR',
|
||
|
'constraint' => '20',
|
||
|
'null' => true
|
||
|
],
|
||
|
'updated_at' => [
|
||
|
'type' => 'DATETIME',
|
||
|
'null' => true,
|
||
|
],
|
||
|
'updated_by' => [
|
||
|
'type' => 'VARCHAR',
|
||
|
'constraint' => '20',
|
||
|
'null' => true
|
||
|
],
|
||
|
'deleted_at' => [
|
||
|
'type' => 'DATETIME',
|
||
|
'null' => true,
|
||
|
],
|
||
|
]);
|
||
|
$this->forge->addKey('pay_group_id', true);
|
||
|
$this->forge->createTable('pay_group');
|
||
|
}
|
||
|
|
||
|
public function down()
|
||
|
{
|
||
|
$this->forge->dropTable('pay_group');
|
||
|
}
|
||
|
}
|