Changes for v22.0.0.OS
This commit is contained in:
31
migrations/v20180325_210101_delete_leave_group_employee.php
Normal file
31
migrations/v20180325_210101_delete_leave_group_employee.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
namespace Classes\Migration;
|
||||
|
||||
class v20180325_210101_delete_leave_group_employee extends AbstractMigration{
|
||||
|
||||
public function up(){
|
||||
|
||||
$sql = <<<'SQL'
|
||||
alter table LeaveGroupEmployees drop FOREIGN KEY `Fk_LeaveGroupEmployees_Employee`;
|
||||
SQL;
|
||||
$this->executeQuery($sql);
|
||||
|
||||
$sql = <<<'SQL'
|
||||
alter table LeaveGroupEmployees drop index `LeaveGroupEmployees_employee`;
|
||||
SQL;
|
||||
$this->executeQuery($sql);
|
||||
|
||||
$sql = <<<'SQL'
|
||||
alter table LeaveGroupEmployees add CONSTRAINT `Fk_LeaveGroupEmployees_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
SQL;
|
||||
return $this->executeQuery($sql);
|
||||
}
|
||||
|
||||
public function down(){
|
||||
$sql = <<<'SQL'
|
||||
alter table LeaveGroupEmployees add UNIQUE KEY `LeaveGroupEmployees_employee` (`employee`);
|
||||
SQL;
|
||||
return $this->executeQuery($sql);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user