Змінено директорії
Додано скрипти CRON Поліпшено механізм запису стендів та їх редагування
This commit is contained in:
17
cron/config/db.js
Normal file
17
cron/config/db.js
Normal file
@@ -0,0 +1,17 @@
|
||||
const sqlite3 = require("sqlite3");
|
||||
const path = require("path");
|
||||
|
||||
const dbPath = process.env.DATABASE_PATH || path.join(__dirname, "..");
|
||||
const fullPath = path.join(dbPath, "database.sqlite");
|
||||
|
||||
const db = new sqlite3.Database(fullPath, (err) => {
|
||||
if (err) {
|
||||
console.error("❌ Failed to open sqlite database:", err);
|
||||
} else {
|
||||
console.log("✅ SQLite DB opened at", fullPath);
|
||||
}
|
||||
});
|
||||
|
||||
db.exec("PRAGMA foreign_keys = ON;");
|
||||
|
||||
module.exports = db;
|
||||
Reference in New Issue
Block a user