BUG: Adding support for PostgreSQL

This commit is contained in:
Kirk Mayo 2013-08-26 14:52:02 +12:00
parent cbbd0a6a4d
commit 01b89a1a85
2 changed files with 4 additions and 4 deletions

View File

@ -9,7 +9,7 @@ class CheckExternalLinksJob extends AbstractQueuedJob {
public static $regenerate_time = 43200;
public function __construct() {
$this->pagesToProcess = DB::query('SELECT ID FROM "SiteTree_Live" WHERE "ShowInSearch"=1')->column();
$this->pagesToProcess = DB::query('SELECT "ID" FROM "SiteTree_Live" WHERE "ShowInSearch"=1')->column();
$this->currentStep = 0;
$this->totalSteps = count($this->pagesToProcess);
}
@ -49,7 +49,7 @@ class CheckExternalLinksJob extends AbstractQueuedJob {
$restart = $this->currentStep == 0;
if ($restart) {
$this->pagesToProcess = DB::query('SELECT ID FROM SiteTree_Live WHERE ShowInSearch=1')->column();
$this->pagesToProcess = DB::query('SELECT "ID" FROM SiteTree_Live WHERE ShowInSearch=1')->column();
}
}

View File

@ -51,8 +51,8 @@ class CheckExternalLinks extends BuildTask {
// use raw sql query to set broken link as calling the dataobject write
// method will reset the links if no broken internal links are found
$query = 'UPDATE SiteTree SET HasBrokenLink = 1 ';
$query .= 'WHERE ID = ' . (int)$page->ID;
$query = "UPDATE \"SiteTree\" SET \"HasBrokenLink\" = 1 ";
$query .= "WHERE \"ID\" = " . (int)$page->ID;
$result = DB::query($query);
if (!$result) {
// error updating hasBrokenLink