I did some stuff with getting it set up and changing photos but i can't get the sqlite to work on prod

This commit is contained in:
2025-05-05 22:50:51 -05:00
parent 94edaa2783
commit 99c4781cb6
8 changed files with 105 additions and 105 deletions
+22
View File
@@ -4,6 +4,28 @@ import { dev } from '$app/environment';
// Initialize the database
const db = new Database(dev ? 'dev.db' : 'prod.db', { create: true});
db.exec(`
CREATE TABLE IF NOT EXISTS users (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL,
email TEXT UNIQUE NOT NULL,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
);
`);
db.exec(`
CREATE TABLE IF NOT EXISTS
'pork_cuts' (
'id' integer not null primary key autoincrement,
'name' varchar(40) null,
'raw_cut' BOOLEAN null,
'stock' INT null default 0,
"preweighed" BOOLEAN NULL,
"min_weight" DOUBLE NULL,
"max_weight" DOUBLE NULL,
unique ('id')
)
`);
// Close the database connection when the application shuts down
process.on('SIGINT', () => {