From 946eb7d95fc04d465802c8fc00e5d4130a52c8f2 Mon Sep 17 00:00:00 2001
From: Random Hacker <random_hacker@xapek.org>
Date: Sat, 23 Feb 2013 01:32:51 +0100
Subject: racket: aufgraeumt, data2c gefixt

---
 ebus-racket/doc/database-schema.sql | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 ebus-racket/doc/database-schema.sql

(limited to 'ebus-racket/doc/database-schema.sql')

diff --git a/ebus-racket/doc/database-schema.sql b/ebus-racket/doc/database-schema.sql
new file mode 100644
index 0000000..281659c
--- /dev/null
+++ b/ebus-racket/doc/database-schema.sql
@@ -0,0 +1,18 @@
+CREATE TABLE sensor (
+        id INTEGER PRIMARY KEY AUTOINCREMENT,
+        name TEXT,
+        description TEXT
+);
+CREATE TABLE value (
+        id INTEGER PRIMARY KEY AUTOINCREMENT,
+        "timestamp" timestamp without time zone,
+        sensor_id integer,
+        type TEXT,
+        value_float real,
+        value_int integer,
+        value_string TEXT,
+        FOREIGN KEY(sensor_id) REFERENCES sensor(id)
+);
+CREATE INDEX sensor_idx_001 on sensor(id);
+CREATE INDEX sensor_idx_002 on sensor(name);
+CREATE INDEX value_idx_001 on value(sensor_id, timestamp);
-- 
cgit v1.2.1

