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.
kwpayroll/app/Database/Migrations/2024-10-07-061029_CreateEmp...

121 lines
3.3 KiB
PHTML

<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
class CreateEmpPayIncomeDeduction extends Migration
{
public function up()
{
$this->forge->addField([
'emppaytransinded_id' => [
'type' => 'INT',
'constraint' => 11,
'unsigned' => true,
'auto_increment' => true
],
'emppaytrans_id' => [
'type' => 'INT',
'constraint' => 11,
'unsigned' => true,
],
'inded_id' => [
'type' => 'INT',
'constraint' => 11,
'unsigned' => true,
],
'payslip_display' => [
'type' => 'VARCHAR',
'constraint' => 25,
'null' => false
],
'inded_name' => [
'type' => 'VARCHAR',
'constraint' => 255,
'null' => false
],
'coa_code' => [
'type' => 'VARCHAR',
'constraint' => 25,
'null' => true,
],
'is_income' => [
'type' => 'TINYINT',
'constraint' => 1,
'null' => false
],
'is_taxable' => [
'type' => 'TINYINT',
'constraint' => 1,
'null' => false
],
'include_in_gross' => [
'type' => 'TINYINT',
'constraint' => 1,
'null' => false
],
'is_fixed_amt' => [
'type' => 'TINYINT',
'constraint' => 1,
'null' => false
],
'is_percent_amt' => [
'type' => 'TINYINT',
'constraint' => 1,
'null' => false
],
'amount' => [
'type' => 'DECIMAL',
'constraint' => '12,4',
'null' => false
],
'base_amount' => [
'type' => 'DECIMAL',
'constraint' => '12,4',
'null' => false
],
'is_override' => [
'type' => 'TINYINT',
'constraint' => 1,
'null' => false
],
// 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('emppaytransinded_id', true);
$this->forge->addForeignKey('emppaytrans_id', 'emp_pay_trans', 'emppaytrans_id', 'CASCADE', 'RESTRICT');
$this->forge->createTable('emp_pay_trans_inded');
}
public function down()
{
$this->forge->dropTable('emp_pay_trans_inded');
}
}