feat: Add PostgreSQL database connection, custom type parsers, and initial schema definition for all application tables.

This commit is contained in:
Michael committed 2025-11-23 17:28:55 +01:00
1 parent e71d81c05d
commit 2703e80afa
1 file changed
+9 -2
+9 -2
View File
@@ -108,6 +108,7 @@ async function initDatabase() {
content TEXT, content TEXT,
image_filename TEXT, image_filename TEXT,
archived BOOLEAN DEFAULT FALSE, archived BOOLEAN DEFAULT FALSE,
archived_at TIMESTAMP,
priority INTEGER DEFAULT 0, priority INTEGER DEFAULT 0,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
@@ -121,7 +122,10 @@ async function initDatabase() {
note_id INTEGER NOT NULL REFERENCES notes(id) ON DELETE CASCADE, note_id INTEGER NOT NULL REFERENCES notes(id) ON DELETE CASCADE,
text TEXT NOT NULL, text TEXT NOT NULL,
completed BOOLEAN DEFAULT FALSE, completed BOOLEAN DEFAULT FALSE,
position INTEGER DEFAULT 0 priority BOOLEAN DEFAULT FALSE,
position INTEGER DEFAULT 0,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
completed_at TIMESTAMP
) )
`); `);
@@ -132,7 +136,10 @@ async function initDatabase() {
user_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE, user_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE,
text TEXT NOT NULL, text TEXT NOT NULL,
completed BOOLEAN DEFAULT FALSE, completed BOOLEAN DEFAULT FALSE,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP priority BOOLEAN DEFAULT FALSE,
in_progress INTEGER DEFAULT 0,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
completed_at TIMESTAMP
) )
`); `);