bank, laporan bank, budgeting badge
This commit is contained in:
+25
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Migration_Add_invoice_visibility_to_company_bank_accounts extends CI_Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
if (!$this->db->table_exists('company_bank_accounts')) return;
|
||||
|
||||
if (!$this->db->field_exists('show_on_invoice', 'company_bank_accounts')) {
|
||||
$this->db->query("ALTER TABLE `company_bank_accounts`
|
||||
ADD `show_on_invoice` TINYINT(1) NOT NULL DEFAULT 1 AFTER `is_primary`");
|
||||
}
|
||||
|
||||
if (!$this->db->query("SHOW INDEX FROM company_bank_accounts WHERE Key_name='idx_company_bank_invoice'")->row()) {
|
||||
$this->db->query("ALTER TABLE `company_bank_accounts`
|
||||
ADD KEY `idx_company_bank_invoice` (`company_id`,`is_active`,`show_on_invoice`,`is_primary`)");
|
||||
}
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
throw new RuntimeException('Pilihan rekening pada PDF Invoice dipertahankan untuk histori dokumen.');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user