From 1123b0db81b6057e113f16a1ddea15c36b7b3d79 Mon Sep 17 00:00:00 2001 From: pks Date: Sun, 27 Sep 2020 20:55:18 +0200 Subject: init --- db-create.rb | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 db-create.rb (limited to 'db-create.rb') diff --git a/db-create.rb b/db-create.rb new file mode 100755 index 0000000..a9bf771 --- /dev/null +++ b/db-create.rb @@ -0,0 +1,24 @@ +#!/usr/bin/env ruby + +require 'sqlite3' + +def main + db = SQLite3::Database.new ARGV[0] + + db.execute <<-SQL + create table power( + id INTEGER PRIMARY KEY, + timestamp DATETIME, + device_name TEXT, + device_location_primary TEXT, + device_location_secondary TEXT, + total FLOAT, + total_start_time DATETIME + ); + SQL + + db.close +end + + +main -- cgit v1.2.3