-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdb_schema.sql
50 lines (50 loc) · 1.32 KB
/
db_schema.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
BEGIN TRANSACTION;
CREATE TABLE IF NOT EXISTS "stats_per_day" (
"date" TEXT,
"unix_timestamp" INTEGER,
"total_consumed_kwh" REAL,
"engine_consumption_kwh" REAL,
"climate_consumption_kwh" REAL,
"onboard_electronics_consumption_kwh" REAL,
"battery_care_consumption_kwh" REAL,
"regenerated_energy_kwh" REAL,
"distance" INTEGER,
"average_consumption_kwh" REAL,
"average_consumption_regen_deducted_kwh" REAL
);
CREATE TABLE IF NOT EXISTS "log" (
"battery_percentage" INTEGER,
"accessory_battery_percentage" INTEGER,
"estimated_range_km" INTEGER,
"timestamp" TEXT,
"unix_timestamp" INTEGER,
"last_vehicule_update_timestamp" TEXT,
"unix_last_vehicle_update_timestamp" INTEGER,
"latitude" TEXT,
"longitude" TEXT,
"odometer" INTEGER,
"charging" INTEGER,
"engine_is_running" INTEGER,
"rough_charging_power_estimate_kw" REAL,
"returned_api_status" TEXT,
"ac_charge_limit_percent" INTEGER,
"dc_charge_limit_percent" INTEGER,
"target_climate_temperature" INTEGER,
"raw_api_data" TEXT
);
CREATE TABLE IF NOT EXISTS "errors" (
"timestamp" TEXT,
"unix_timestamp" INTEGER,
"exc_type" TEXT,
"exc_args" TEXT
);
CREATE TABLE IF NOT EXISTS "trips" (
"unix_timestamp" INTEGER,
"date" TEXT,
"driving_time_minutes" INTEGER,
"idle_time_minutes" INTEGER,
"distance_km" INTEGER,
"avg_speed_kmh" INTEGER,
"max_speed_kmh" INTEGER
);
COMMIT;