diff --git a/migrations/0015__trim_note_ids.sql b/migrations/0015__trim_note_ids.sql new file mode 100644 index 000000000..3b981d172 --- /dev/null +++ b/migrations/0015__trim_note_ids.sql @@ -0,0 +1,6 @@ +UPDATE notes SET note_id = substr(note_id, 0, 22); +UPDATE notes_tree SET note_id = substr(note_id, 0, 22), note_pid = substr(note_pid, 0, 22); +UPDATE notes_history SET note_id = substr(note_id, 0, 22); +UPDATE audit_log SET note_id = substr(note_id, 0, 22); +UPDATE links SET note_id = substr(note_id, 0, 22); +UPDATE images SET note_id = substr(note_id, 0, 22); \ No newline at end of file diff --git a/routes/api/audit.js b/routes/api/audit.js index 4311d0d9e..4e376d680 100644 --- a/routes/api/audit.js +++ b/routes/api/audit.js @@ -13,9 +13,6 @@ router.get('/:full_load_time', auth.checkApiAuth, async (req, res, next) => { const row = await sql.getSingleResult("SELECT COUNT(*) AS 'count' FROM audit_log WHERE (browser_id IS NULL OR browser_id != ?) " + "AND date_modified >= ?", [browserId, fullLoadTime]); - console.log("SELECT COUNT(*) AS 'count' FROM audit_log WHERE (browser_id IS NULL OR browser_id != ?) " + - "AND date_modified >= ?"); - res.send({ 'changed': row.count > 0 }); diff --git a/services/migration.js b/services/migration.js index 01126d09e..db215ba95 100644 --- a/services/migration.js +++ b/services/migration.js @@ -3,7 +3,7 @@ const sql = require('./sql'); const fs = require('fs-extra'); const log = require('./log'); -const APP_DB_VERSION = 14; +const APP_DB_VERSION = 15; const MIGRATIONS_DIR = "./migrations"; async function migrate() {