Migrate::_get_db_schema_version PHP Method

_get_db_schema_version() private method

Retrieves current schema version of the db
private _get_db_schema_version ( ) : integer
return integer Current Schema version
    private function _get_db_schema_version()
    {
        if ($this->_ci->db->table_exists('settings')) {
            $this->_ci->db->select('option_value')->from('settings')->where('option_name', 'script_db_version');
            $query = $this->_ci->db->get();
            if ($query->num_rows() > 0) {
                $row = $query->row();
                return $row->option_value;
            }
            return 1;
        } else {
            return 0;
        }
    }