Added database creation upon start of API, only does this when the Database doesn't exist.
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user