Added database creation upon start of API, only does this when the Database doesn't exist.

This commit is contained in:
Lynixenn
2025-03-28 23:51:03 +01:00
parent cfcfd4ba5e
commit 895a40fe67
3 changed files with 71 additions and 33 deletions

View File

@@ -55,7 +55,7 @@ export function createDatabase(): void {
date_created_at TEXT,
text TEXT,
likes INTEGER
); -- Added semicolon here
);
CREATE TABLE IF NOT EXISTS messages (
message_id INTEGER PRIMARY KEY AUTOINCREMENT,
@@ -105,6 +105,3 @@ export function insertSampleData(): void {
`,
);
}
createDatabase();
insertSampleData();