HEX
Server: LiteSpeed
System: Linux s12873.lon1.stableserver.net 5.14.0-611.11.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Dec 3 09:47:37 EST 2025 x86_64
User: jairicem (1242)
PHP: 8.2.31
Disabled: NONE
Upload Files
File: /home/jairicem/kunakornthairestaurant.com/app/migrations/305_update305.php
<?php defined('BASEPATH') OR exit('No direct script access allowed');

class Migration_Update305 extends CI_Migration {

    public function up() {
        
        $set = array('sac' => array('type' => 'TINYINT', 'constraint' => '1', 'default' => 0));
        $this->dbforge->add_column('settings', $set);

        $rp = array('real_unit_price' => array('type' => 'DECIMAL', 'constraint' => '25,4', 'default' => 0, 'null' => TRUE));
        $this->dbforge->add_column('sale_items', $rp);
        $this->dbforge->add_column('quote_items', $rp);
        $this->dbforge->add_column('return_items', $rp);

        $rc = array(
            'real_unit_cost' => array('type' => 'DECIMAL', 'constraint' => '25,4', 'default' => 0, 'null' => TRUE),
            'unit_cost' => array('type' => 'DECIMAL', 'constraint' => '25,4', 'null' => TRUE),
            );
        $this->dbforge->add_column('purchase_items', $rc);

        $trc = array(
            'real_unit_cost' => array('type' => 'DECIMAL', 'constraint' => '25,4', 'default' => 0, 'null' => TRUE),
            'unit_cost' => array('type' => 'DECIMAL', 'constraint' => '25,4', 'null' => TRUE),
            'date' => array('type' => 'DATE', 'null' => TRUE),
            );
        $this->dbforge->add_column('transfer_items', $trc);

        $srp = array('real_unit_price' => array('type' => 'DECIMAL', 'constraint' => '25,4', 'default' => 0, 'null' => TRUE));
        $this->dbforge->add_column('suspended_items', $srp);

    }

}