Move ooye.db to current working dir

This commit is contained in:
Cadence Ember
2024-09-15 01:09:47 +12:00
parent b8962780ae
commit 01af302796
10 changed files with 20 additions and 18 deletions

View File

@@ -7,7 +7,7 @@
const sqlite = require("better-sqlite3")
const passthrough = require("../src/passthrough")
const db = new sqlite("db/ooye.db")
const db = new sqlite("ooye.db")
const migrate = require("../src/db/migrate")
Object.assign(passthrough, {db})

View File

@@ -17,7 +17,7 @@ const oldAT = reg.old_bridge.as_token
const newAT = reg.as_token
const oldDB = new sqlite(reg.old_bridge.database)
const db = new sqlite("db/ooye.db")
const db = new sqlite("ooye.db")
db.exec(`CREATE TABLE IF NOT EXISTS half_shot_migration (
discord_channel TEXT NOT NULL,

View File

@@ -6,7 +6,7 @@ const HeatSync = require("heatsync")
const {reg} = require("../src/matrix/read-registration")
const passthrough = require("../src/passthrough")
const db = new sqlite("db/ooye.db")
const db = new sqlite("ooye.db")
const sync = new HeatSync({watchFS: false})

View File

@@ -5,7 +5,7 @@ const sqlite = require("better-sqlite3")
const HeatSync = require("heatsync")
const passthrough = require("../src/passthrough")
const db = new sqlite("db/ooye.db")
const db = new sqlite("ooye.db")
const sync = new HeatSync({watchFS: false})

View File

@@ -21,11 +21,11 @@ const args = require("minimist")(process.argv.slice(2), {string: ["emoji-guild"]
// Move database file if it's still in the old location
if (fs.existsSync("db")) {
if (fs.existsSync("db/ooye.db")) {
fs.renameSync("db/ooye.db", "src/db/ooye.db")
fs.renameSync("db/ooye.db", "ooye.db")
}
const files = fs.readdirSync("db")
if (files.length) {
console.error("You must manually move or delete the files in the db folder:")
console.error("The db folder is deprecated and must be removed. Your ooye.db database file has already been moved to the root of the repo. You must manually move or delete the remaining files:")
for (const file of files) {
console.error(file)
}
@@ -35,7 +35,7 @@ if (fs.existsSync("db")) {
}
const passthrough = require("../src/passthrough")
const db = new sqlite("src/db/ooye.db")
const db = new sqlite("ooye.db")
const migrate = require("../src/db/migrate")
const sync = new HeatSync({watchFS: false})

View File

@@ -2,6 +2,6 @@
// @ts-check
const sqlite = require("better-sqlite3")
const db = new sqlite("db/ooye.db", {fileMustExist: true})
const db = new sqlite("ooye.db", {fileMustExist: true})
db.pragma("journal_mode = wal")
db.close()