From ead710db271795380207141f0add7278ba12ada0 Mon Sep 17 00:00:00 2001
From: lonkaars <loek@pipeframe.xyz>
Date: Thu, 27 Oct 2022 10:56:26 +0200
Subject: finish merge and fix sql scripts

---
 scripts/db-init.sql | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

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

diff --git a/scripts/db-init.sql b/scripts/db-init.sql
index 4c4c4d4..2b0581c 100644
--- a/scripts/db-init.sql
+++ b/scripts/db-init.sql
@@ -1,9 +1,11 @@
-CREATE SCHEMA `WSdb`;
-CREATE TABLE `DAB1Pract1`.`tblMain` (
-  `ID` INT GENERATED ALWAYS AS (),
-  `temperature` DECIMAL(5,2) NULL,
-  `humidity` DECIMAL(5,2) NULL,
-  `pressure` DECIMAL(5,2) NULL,
-  `time` DATETIME NULL,
-  PRIMARY KEY (`ID`),
-  UNIQUE INDEX `ID_UNIQUE` (`ID` ASC) VISIBLE);
+drop schema if exists `WSdb`;
+create schema if not exists `WSdb`;
+drop table if exists `WSdb`.`tblMain`;
+create table if not exists `WSdb`.`tblMain` (
+  id int unsigned not null auto_increment,
+  temperature decimal(5,2) null,
+  humidity decimal(5,2) null,
+  pressure decimal(5,2) null,
+  time datetime null,
+  primary key (id)
+);
-- 
cgit v1.2.3

