# Move to the latest "V1" state of the database if not there
# already.
"CREATE TABLE IF NOT EXISTS diffs (" +
- "id INTEGER PRIMARY KEY, " +
+ "id INTEGER PRIMARY KEY, " +
"zone_id INTEGER NOT NULL," +
"version INTEGER NOT NULL, " +
"operation INTEGER NOT NULL, " +
def match_version(db, expected):
"""
@brief Check database version against that expected
-
+
Checks whether the version of the database matches that expected for
the upgrade. Both the major and minor versions must match.
echo "3.1. Database is not an SQLite file - check"
echo "This is not an sqlite3 database" > $tempfile
-../run_dbutil.sh --check $tempfile
+../run_dbutil.sh --check $tempfile
failzero $?
check_no_backup $tempfile $backupfile
echo "3.2. Database is not an SQLite file - upgrade"
-../run_dbutil.sh --upgrade --noconfirm $tempfile
+../run_dbutil.sh --upgrade --noconfirm $tempfile
failzero $?
# ...and as before, a backup should have been created
check_backup $tempfile $backupfile