aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorUnavailableDev <69792062+UnavailableDev@users.noreply.github.com>2022-10-30 12:40:43 +0100
committerUnavailableDev <69792062+UnavailableDev@users.noreply.github.com>2022-10-30 12:40:43 +0100
commit6b2ff1c137773b91ce9552446a7ac91dd951b02b (patch)
treed0ed1f806420bd65b11c272f7dd096a347512818 /scripts
parentb1ae05783ba4360a54d049fd89dee53699e18e0f (diff)
added auto timestamp and fixed for empty database
Diffstat (limited to 'scripts')
-rw-r--r--scripts/db-init.sql3
1 files changed, 2 insertions, 1 deletions
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);