<?php defined('BASEPATH') OR exit('No direct script access allowed');
class Migration_Version_129 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('warehouse');

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

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

        
    }

    public function down() {
        
    }
}