summaryrefslogtreecommitdiff
path: root/db-create.rb
blob: a9bf771fd64c92b9e83f5885da88e7a4af8d6c8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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