diff --git a/backend/db.js b/backend/db.js index 1273a32..6039e2f 100644 --- a/backend/db.js +++ b/backend/db.js @@ -43,6 +43,15 @@ async function createTables() { ) `); + // Create contacts table + await db.query(` + CREATE TABLE IF NOT EXISTS contacts ( + username TEXT NOT NULL, + contact TEXT NOT NULL, + status TEXT NOT NULL + ) + `); + console.log('Tables created successfully'); } catch (err) { console.error('Error creating tables:', err); diff --git a/docker-compose.yaml b/docker-compose.yaml index fd2ec14..27d3448 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -34,7 +34,8 @@ services: ports: - ${APP_PORT}:${APP_PORT} depends_on: - - db + db: + condition: service_healthy volumes: db-data: diff --git a/frontend/routes/chat.html b/frontend/routes/chat.html index 8e499db..8bfbe49 100644 --- a/frontend/routes/chat.html +++ b/frontend/routes/chat.html @@ -18,6 +18,7 @@