public function db_schema_check($db)
    {
        if (!$this->configured) {
            return false;
        }

        // read reference schema from mysql.initial.sql
        $engine    = $db->db_provider;
        $db_schema = $this->db_read_schema(INSTALL_PATH . "SQL/$engine.initial.sql");
        $errors    = array();

        // check list of tables
        $existing_tables = $db->list_tables();

        foreach ($db_schema as $table => $cols) {
            $table = $this->config['db_prefix'] . $table;

            if (!in_array($table, $existing_tables)) {
                $errors[] = "Missing table '".$table."'";
            }
            else {  // compare cols
                $db_cols = $db->list_cols($table);
                $diff    = array_diff(array_keys($cols), $db_cols);

                if (!empty($diff)) {
                    $errors[] = "Missing columns in table '$table': " . join(',', $diff);
                }
            }
        }

        return !empty($errors) ? $errors : false;
    }