Remove dependency on sqlite3_table_column_metadata

Not all SQLite builds have the function sqlite3_table_column_metadata.
We were only using it in a schema upgrade check for compatibility with
databases that were probably never seen in the wild.  So remove it.
This commit is contained in:
Eelco Dolstra 2012-03-01 16:04:12 +01:00
parent 1c94524458
commit 8afd28a922

View File

@ -356,13 +356,6 @@ void LocalStore::openDB(bool create)
throwSQLiteError(db, "initialising database schema");
}
/* Backwards compatibility with old (pre-release) databases. Can
remove this eventually. */
if (sqlite3_table_column_metadata(db, 0, "ValidPaths", "narSize", 0, 0, 0, 0, 0) != SQLITE_OK) {
if (sqlite3_exec(db, "alter table ValidPaths add column narSize integer" , 0, 0, 0) != SQLITE_OK)
throwSQLiteError(db, "adding column narSize");
}
/* Prepare SQL statements. */
stmtRegisterValidPath.create(db,
"insert into ValidPaths (path, hash, registrationTime, deriver, narSize) values (?, ?, ?, ?, ?);");