summaryrefslogtreecommitdiff
path: root/v1/create-db.rb
diff options
context:
space:
mode:
authorpks <pks@pks.rocks>2021-05-10 13:23:21 +0200
committerpks <pks@pks.rocks>2021-05-10 13:23:21 +0200
commit281fa36a24f81d87543a7791252954414e161565 (patch)
treeab45e491aa93924f7310303913f2df2d3f3b069f /v1/create-db.rb
parent69e11599c2194187e1c172ebe6b7b51945a7f306 (diff)
rm v0 v1
Diffstat (limited to 'v1/create-db.rb')
-rwxr-xr-xv1/create-db.rb51
1 files changed, 0 insertions, 51 deletions
diff --git a/v1/create-db.rb b/v1/create-db.rb
deleted file mode 100755
index 2866b7b..0000000
--- a/v1/create-db.rb
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/usr/bin/env ruby
-
-require 'sqlite3'
-
-db = SQLite3::Database.new("weather.db")
-
-db.execute <<-SQL
- create table rain(
- id INTEGER PRIMARY KEY,
- timestamp DATETIME DEFAULT CURRENT_TIMESTAMP,
- device_type TEXT,
- device_id TEXT,
- battery INTEGER,
- rssi INTEGER,
- rain_rate FLOAT,
- rain_total FLOAT
- );
- SQL
-db.execute <<-SQL
- create table wind(
- id INTEGER PRIMARY KEY,
- timestamp DATETIME DEFAULT CURRENT_TIMESTAMP,
- device_type TEXT,
- device_id TEXT,
- battery INTEGER,
- rssi INTEGER,
- chill FLOAT,
- temperature FLOAT,
- average_speed FLOAT,
- direction INTEGER,
- gust FLOAT
- );
- SQL
-db.execute <<-SQL
- create table temp(
- id INTEGER PRIMARY KEY,
- timestamp DATETIME DEFAULT CURRENT_TIMESTAMP,
- device_type TEXT,
- device_id TEXT,
- battery INTEGER,
- rssi INTEGER,
- humidity FLOAT,
- humidity_status TEXT,
- humidity_status_numeric INTEGER,
- temperature FLOAT,
- forecast TEXT,
- forecast_numeric INTEGER
- );
- SQL
-
-db.close