Update besar apk finance

This commit is contained in:
Wian Drs
2026-09-11 16:03:00 +07:00
parent d42483b350
commit 4ef15c22ae
897 changed files with 98056 additions and 15979 deletions
@@ -0,0 +1,19 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Migration_Enhance_role_management extends CI_Migration
{
public function up()
{
if (!$this->db->field_exists('is_system', 'roles')) $this->db->query("ALTER TABLE roles ADD is_system TINYINT(1) NOT NULL DEFAULT 0 AFTER is_active");
if (!$this->db->field_exists('is_super_admin', 'roles')) $this->db->query("ALTER TABLE roles ADD is_super_admin TINYINT(1) NOT NULL DEFAULT 0 AFTER is_system");
if (!$this->db->field_exists('created_at', 'roles')) $this->db->query("ALTER TABLE roles ADD created_at DATETIME NULL AFTER is_super_admin");
if (!$this->db->field_exists('updated_at', 'roles')) $this->db->query("ALTER TABLE roles ADD updated_at DATETIME NULL AFTER created_at");
$this->db->set('is_system', 1)->update('roles');
$this->db->where('nama_role', 'Admin')->update('roles', array(
'is_super_admin' => 1,
'description' => 'Master Admin: akses penuh seluruh modul, transaksi, posting, approval, konfigurasi, pengguna dan role.',
'is_active' => 1
));
}
public function down() { throw new RuntimeException('Gunakan backup untuk rollback manajemen role.'); }
}