diff options
Diffstat (limited to 'src/schema.rs')
-rw-r--r-- | src/schema.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/schema.rs b/src/schema.rs new file mode 100644 index 0000000..04e88dc --- /dev/null +++ b/src/schema.rs @@ -0,0 +1,18 @@ +table! { + data (device_id, timestamp) { + device_id -> Text, + timestamp -> Timestamp, + value -> Double, + } +} + +table! { + devices (device_id) { + device_id -> Text, + name -> Text, + } +} + +joinable!(data -> devices (device_id)); + +allow_tables_to_appear_in_same_query!(data, devices,); |