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.
23 lines
705 B
PHTML
23 lines
705 B
PHTML
7 months ago
|
<?php
|
||
|
|
||
|
namespace App\Database\Migrations;
|
||
|
|
||
|
use CodeIgniter\Database\Migration;
|
||
|
|
||
|
class AddConstraintOnEmployeePayInfo extends Migration
|
||
|
{
|
||
|
public function up()
|
||
|
{
|
||
|
$this->forge->addForeignKey('employee_id', 'employee', 'employee_id', 'CASCADE', 'RESTRICT');
|
||
|
$this->forge->addForeignKey('paytype_id', 'pay_type', 'paytype_id', 'CASCADE', 'RESTRICT');
|
||
|
$this->forge->processIndexes('emp_pay_info');
|
||
|
}
|
||
|
|
||
|
public function down()
|
||
|
{
|
||
|
$this->forge->dropForeignKey('emp_pay_info', 'emp_pay_info_employee_id_foreign');
|
||
|
$this->forge->dropForeignKey('emp_pay_info', 'emp_pay_info_paytype_id_foreign');
|
||
|
$this->forge->processIndexes('emp_pay_info');
|
||
|
}
|
||
|
}
|