1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-26 14:21:28 +00:00

perform backend sanity check on startup, update schema version in backend.php

This commit is contained in:
Andrew Dolgov
2005-11-16 08:59:46 +01:00
parent 1089b16bc2
commit 295f9b422a
4 changed files with 78 additions and 7 deletions

View File

@@ -1,5 +1,5 @@
<?
define(SCHEMA_VERSION, 1);
define(SCHEMA_VERSION, 2);
$op = $_GET["op"];
@@ -28,6 +28,7 @@
pg_query("set client_encoding = 'utf-8'");
}
/*
$result = db_query($link, "SELECT schema_version FROM ttrss_version");
$schema_version = db_fetch_result($result, 0, "schema_version");
@@ -37,7 +38,8 @@
(got version $schema_version; expected ".SCHEMA_VERSION.")";
return;
}
*/
$fetch = $_GET["fetch"];
/* FIXME this needs reworking */
@@ -360,6 +362,21 @@
print "Marked active page as read.";
}
if ($subop == "sanityCheck") {
$error_code = 0;
$result = db_query($link, "SELECT schema_version FROM ttrss_version");
$schema_version = db_fetch_result($result, 0, "schema_version");
if ($schema_version != SCHEMA_VERSION) {
$error_code = 5;
}
print "<error code='$error_code'/>";
}
}
if ($op == "feeds") {