aboutsummaryrefslogtreecommitdiff
path: root/scripts/db-init.sql
diff options
context:
space:
mode:
authorUnavailableDev <69792062+UnavailableDev@users.noreply.github.com>2022-10-30 10:57:11 +0100
committerUnavailableDev <69792062+UnavailableDev@users.noreply.github.com>2022-10-30 10:57:50 +0100
commit8952e19f00e0930e53e3731fd30be5e2600d9fd6 (patch)
tree2770bfd4319402c88b6872d1f8699252329c6603 /scripts/db-init.sql
parent6d9df6fe97502a852b68c8c8e6781d7208170cae (diff)
parent60f954dbaa399f8f0bcaeeb307953fc3b37b9dc7 (diff)
finish merge
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)
+);