From 6b2ff1c137773b91ce9552446a7ac91dd951b02b Mon Sep 17 00:00:00 2001
From: UnavailableDev <69792062+UnavailableDev@users.noreply.github.com>
Date: Sun, 30 Oct 2022 12:40:43 +0100
Subject: added auto timestamp and fixed for empty database

---
 scripts/db-init.sql | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'scripts/db-init.sql')

diff --git a/scripts/db-init.sql b/scripts/db-init.sql
index 2b0581c..050f51f 100644
--- a/scripts/db-init.sql
+++ b/scripts/db-init.sql
@@ -6,6 +6,7 @@ create table if not exists `WSdb`.`tblMain` (
   temperature decimal(5,2) null,
   humidity decimal(5,2) null,
   pressure decimal(5,2) null,
-  time datetime null,
+  time datetime default CURRENT_TIMESTAMP(),
   primary key (id)
 );
+INSERT INTO `WSdb`.`tblMain` (`ID`) VALUES (0);
-- 
cgit v1.2.3

