<?php defined('BASEPATH') OR exit('No direct script access allowed');
class Migration_Version_130 extends CI_Migration {

    /**
     * First we check package version
     * Then if we have pro package we will uninstall the warehouse and install it again
     */
    public function up() {
        

        // Get package id
        $id_package = (int)getenv('active_package');

        $CI = &get_instance();

        // Deactivate
        $CI->app_modules->deactivate('omni_sales');

        // Activate
        $CI->app_modules->activate('omni_sales');
        
        // Activate
        $CI->app_modules->activate('omni_sales');


        // Uninstall and install again
        if($id_package != 3){
            $CI->app_modules->deactivate('omni_sales');
        }

        
    }

    public function down() {
        
    }
}