perbaikan bug global loading HR dan Payroll
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Migration_Normalize_employee_resign_dates extends CI_Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
if (!$this->db->table_exists('k_employees') || !$this->db->field_exists('resign_date', 'k_employees')) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Database lama memakai zero-date sebagai nilai kosong. NULL adalah
|
||||
// representasi yang valid untuk karyawan yang belum/tidak resign.
|
||||
$this->db->query("UPDATE k_employees SET resign_date = NULL WHERE CAST(resign_date AS CHAR) = '0000-00-00'");
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
// Tidak dikembalikan ke zero-date karena nilai tersebut tidak valid
|
||||
// pada MySQL strict mode.
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user