Skip to content

Commit

Permalink
comment out unneded log messages
Browse files Browse the repository at this point in the history
  • Loading branch information
crschardt committed Dec 17, 2023
1 parent 35b637d commit c19f9e8
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -167,26 +167,26 @@ private void initDatabase() {
var sql =
"SELECT COUNT(*) AS CNTREC FROM pragma_table_info('cameras') WHERE name='otherpaths_json';";
var result = oldCameraTableStatement.executeQuery(sql);
logger.debug("otherpaths_json: " + String.valueOf(result.getInt("CNTREC")));
// logger.debug("otherpaths_json: " + String.valueOf(result.getInt("CNTREC")));
if (result.getInt("CNTREC") == 0) {
// This is an older table, need to migrate to the new format
oldTable = true;
}
} catch (SQLException e) {
logger.error("Err checking for missing otherpaths_json column in cameras table", e);
}
logger.debug("otherpaths_json missing: " + String.valueOf(oldTable));
}

// logger.debug("otherpaths_json missing: " + String.valueOf(oldTable));

if (oldTable == true){
try {
updateCameraTableStatement = conn.createStatement();
// String[] otherPaths = {};
var sql =
"ALTER TABLE cameras ADD COLUMN otherpaths_json TEXT NOT NULL DEFAULT '[]'";
updateCameraTableStatement.execute(sql);
logger.debug("Added column otherpaths_json to cameras table");
logger.info("Added column otherpaths_json to cameras table");
} catch (SQLException e) {
logger.error("Err updating cameras table with otherpaths_json column", e);
logger.error("Err adding otherpaths_json column to cameras table", e);
}
}

Expand All @@ -196,6 +196,7 @@ private void initDatabase() {
if (createGlobalTableStatement != null) createGlobalTableStatement.close();
if (createCameraTableStatement != null) createCameraTableStatement.close();
if (oldCameraTableStatement != null) oldCameraTableStatement.close();
if (updateCameraTableStatement != null) updateCameraTableStatement.close();
if (conn != null) conn.close();
} catch (SQLException e) {
e.printStackTrace();
Expand Down

0 comments on commit c19f9e8

Please sign in to comment.