aboutsummaryrefslogtreecommitdiff
path: root/scripts/db-init.sql
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/db-init.sql')
-rw-r--r--scripts/db-init.sql20
1 files changed, 11 insertions, 9 deletions
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)
+);