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.
92 lines
2.6 KiB
PHTML
92 lines
2.6 KiB
PHTML
8 months ago
|
<?php
|
||
|
|
||
|
namespace App\Database\Migrations;
|
||
|
|
||
|
use CodeIgniter\Database\Migration;
|
||
|
|
||
|
class CreateEmpPayIncomeDeduction extends Migration
|
||
|
{
|
||
|
public function up()
|
||
|
{
|
||
|
$this->forge->addField([
|
||
|
'emppayinded_id' => [
|
||
|
'type' => 'INT',
|
||
|
'constraint' => 11,
|
||
|
'unsigned' => true,
|
||
|
'auto_increment' => true
|
||
|
],
|
||
|
'emppay_id' => [
|
||
|
'type' => 'INT',
|
||
|
'constraint' => 11,
|
||
|
'unsigned' => true,
|
||
|
],
|
||
8 months ago
|
'payschedule_id' => [
|
||
|
'type' => 'INT',
|
||
|
'constraint' => 11,
|
||
|
'unsigned' => true,
|
||
|
],
|
||
8 months ago
|
'inded_id' => [
|
||
|
'type' => 'INT',
|
||
|
'constraint' => 11,
|
||
|
'unsigned' => true,
|
||
|
],
|
||
|
'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
|
||
|
],
|
||
|
'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('emppayinded_id', true);
|
||
|
$this->forge->addForeignKey('emppay_id', 'emp_pay_info', 'emppay_id', 'CASCADE', 'RESTRICT');
|
||
8 months ago
|
$this->forge->addForeignKey('payschedule_id', 'pay_schedule', 'payschedule_id', 'CASCADE', 'RESTRICT');
|
||
8 months ago
|
$this->forge->addForeignKey('inded_id', 'pay_income_deduction', 'inded_id', 'CASCADE', 'RESTRICT');
|
||
|
$this->forge->createTable('emp_pay_inded');
|
||
|
}
|
||
|
|
||
|
public function down()
|
||
|
{
|
||
|
$this->forge->dropTable('emp_pay_inded');
|
||
|
}
|
||
|
}
|