/**
  * Adds the sequences for this database.
  *
  * @param Database $database
  */
 protected function addSequences(Database $database)
 {
     $searchPath = '?';
     $params = [$database->getSchema()];
     if (!$database->getSchema()) {
         $stmt = $this->dbh->query('SHOW search_path');
         $searchPathString = $stmt->fetchColumn();
         $params = [];
         $searchPath = explode(',', $searchPathString);
         foreach ($searchPath as &$path) {
             $params[] = $path;
             $path = '?';
         }
         $searchPath = implode(', ', $searchPath);
     }
     $stmt = $this->dbh->prepare("\n            SELECT c.relname, n.nspname\n            FROM pg_class c, pg_namespace n\n            WHERE\n                n.oid = c.relnamespace\n            AND c.relkind = 'S'\n            AND n.nspname IN ({$searchPath});\n        ");
     $stmt->execute($params);
     while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
         $name = $row['nspname'] . '.' . $row['relname'];
         $database->addSequence($name);
     }
 }