chore: format all files

This commit is contained in:
C4illin 2025-06-03 19:19:28 +02:00
parent ff2c0057e8
commit 1be11708c4
45 changed files with 2828 additions and 3057 deletions

View file

@ -1,4 +1,5 @@
import { Database } from "bun:sqlite";
const db = new Database("./data/mydb.sqlite", { create: true });
if (!db.query("SELECT * FROM sqlite_master WHERE type='table'").get()) {
@ -27,13 +28,9 @@ CREATE TABLE IF NOT EXISTS jobs (
PRAGMA user_version = 1;`);
}
const dbVersion = (
db.query("PRAGMA user_version").get() as { user_version?: number }
).user_version;
const dbVersion = (db.query("PRAGMA user_version").get() as { user_version?: number }).user_version;
if (dbVersion === 0) {
db.exec(
"ALTER TABLE file_names ADD COLUMN status TEXT DEFAULT 'not started';",
);
db.exec("ALTER TABLE file_names ADD COLUMN status TEXT DEFAULT 'not started';");
db.exec("PRAGMA user_version = 1;");
console.log("Updated database to version 1.");
}
@ -41,4 +38,4 @@ if (dbVersion === 0) {
// enable WAL mode
db.exec("PRAGMA journal_mode = WAL;");
export default db;
export default db;

View file

@ -20,4 +20,4 @@ export class User {
id!: number;
email!: string;
password!: string;
}
}