diff options
-rw-r--r-- | backend.php | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/backend.php b/backend.php index 611b67b38..2a8657474 100644 --- a/backend.php +++ b/backend.php @@ -1,4 +1,6 @@ <? + define(SCHEMA_VERSION, 2); + $op = $_GET["op"]; if ($op == "rpc") { @@ -25,6 +27,16 @@ if (DB_TYPE == "pgsql") { 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"); + + if ($schema_version != SCHEMA_VERSION) { + print "Error: database schema is invalid + (got version $schema_version; expected ".SCHEMA_VERSION.")"; + return; + } $fetch = $_GET["fetch"]; |