From 4ec446240cbd9e720cd7400872811c7b343bbef0 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Fri, 24 Sep 2010 17:18:44 +0200 Subject: [PATCH 1/2] readded mysql schema reworked README --- README | 22 ++++++++++++++++------ share/sql/mysql.sql | 22 ++++++++++------------ share/tools/install.php | 4 ++-- 3 files changed, 28 insertions(+), 20 deletions(-) diff --git a/README b/README index 5ea3ea0..d69b2ac 100644 --- a/README +++ b/README @@ -1,9 +1,19 @@ -Hier finden sich alle Skripte, die auf volkszaehler.org laufen. -Ziel: -- mein.volkszaehler (Betrieb eines eigenen Servers für Protokollierung und Auswertung) -- Weiterentwicklung volkszaehler.org +Hier finden sich alle Skripte, die auf volkszaehler.org laufen: + +volkszaehler.org/ + |_ frontend/ Web Frontend + |_ backend/ PHP Backend + |_ controller/ Controller Code für verschiedene Plattformen/Programmiersprachen + | \_ php/ Einfach Referenzimplementation des Controller-Codes in PHP + | + \_ share/ Gemeinsam genutze Codebestandteile + |_ docs/ Dokumentation + |_ definitions/ Gemeinsame Definitionen über Entities und deren Eigenschaften für Controller, Backend & Frontend + |_ sql/ SQL-Schema Dumps für verschieden Datenbanksysteme + | \_ demo/ Demo Daten zum Import in die Datenbank + | + |_ tools/ Verschiedene Scripts zum Importieren von Daten, Installation, Helper etc. + \_ tests/ Einfache Testcases für einige Klasses des Backends Wiki: http://wiki.volkszaehler.org Other: http://volkszaehler.org - -Weitere Informationen liegen unter share/docs diff --git a/share/sql/mysql.sql b/share/sql/mysql.sql index 7d167c3..e3fe85b 100644 --- a/share/sql/mysql.sql +++ b/share/sql/mysql.sql @@ -1,12 +1,10 @@ -Creating database schema... - - - - [PDOException] - SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'entities' already exists - - - -orm:schema-tool:create [--dump-sql] [-h|--help] [-q|--quiet] [-v|--verbose] [-V|--version] [-a|--ansi] [-n|--no-interaction] command - - +CREATE TABLE entities (id SMALLINT AUTO_INCREMENT NOT NULL, uuid VARCHAR(36) NOT NULL, type VARCHAR(255) NOT NULL, class VARCHAR(255) NOT NULL, UNIQUE INDEX entities_uuid_uniq (uuid), PRIMARY KEY(id)) ENGINE = InnoDB; +CREATE TABLE entities_in_aggregator (parent_id SMALLINT NOT NULL, child_id SMALLINT NOT NULL, PRIMARY KEY(parent_id, child_id)) ENGINE = InnoDB; +CREATE TABLE data (id SMALLINT AUTO_INCREMENT NOT NULL, channel_id SMALLINT DEFAULT NULL, timestamp BIGINT NOT NULL, value NUMERIC(5, 2) NOT NULL, UNIQUE INDEX unique_timestamp (timestamp, channel_id), PRIMARY KEY(id)) ENGINE = InnoDB; +CREATE TABLE tokens (id SMALLINT AUTO_INCREMENT NOT NULL, entity_id SMALLINT DEFAULT NULL, token VARCHAR(255) NOT NULL, valid BIGINT NOT NULL, UNIQUE INDEX tokens_token_uniq (token), PRIMARY KEY(id)) ENGINE = InnoDB; +CREATE TABLE properties (id SMALLINT AUTO_INCREMENT NOT NULL, entity_id SMALLINT DEFAULT NULL, `key` VARCHAR(255) NOT NULL, value VARCHAR(255) NOT NULL, UNIQUE INDEX unique_keys (entity_id, `key`), PRIMARY KEY(id)) ENGINE = InnoDB; +ALTER TABLE entities_in_aggregator ADD FOREIGN KEY (parent_id) REFERENCES entities(id); +ALTER TABLE entities_in_aggregator ADD FOREIGN KEY (child_id) REFERENCES entities(id); +ALTER TABLE data ADD FOREIGN KEY (channel_id) REFERENCES entities(id); +ALTER TABLE tokens ADD FOREIGN KEY (entity_id) REFERENCES entities(id); +ALTER TABLE properties ADD FOREIGN KEY (entity_id) REFERENCES entities(id) diff --git a/share/tools/install.php b/share/tools/install.php index e11ea52..dda5d40 100644 --- a/share/tools/install.php +++ b/share/tools/install.php @@ -34,10 +34,10 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - volkszaehler.org - installation + volkszaehler.org - setup -

volkszaehler.org - installation

+

volkszaehler.org - setup

Date: Fri, 24 Sep 2010 17:20:38 +0200 Subject: [PATCH 2/2] cosmetics --- README | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README b/README index d69b2ac..a4cdf47 100644 --- a/README +++ b/README @@ -4,16 +4,16 @@ volkszaehler.org/ |_ frontend/ Web Frontend |_ backend/ PHP Backend |_ controller/ Controller Code für verschiedene Plattformen/Programmiersprachen - | \_ php/ Einfach Referenzimplementation des Controller-Codes in PHP + | \_ php/ Einfach Referenzimplementation des Controller-Codes in PHP | - \_ share/ Gemeinsam genutze Codebestandteile + \_ share/ Gemeinsam genutze Codebestandteile |_ docs/ Dokumentation - |_ definitions/ Gemeinsame Definitionen über Entities und deren Eigenschaften für Controller, Backend & Frontend + |_ definitions/ Gemeinsame Definitionen über Entities und deren Eigenschaften für Controller, Backend & Frontend |_ sql/ SQL-Schema Dumps für verschieden Datenbanksysteme | \_ demo/ Demo Daten zum Import in die Datenbank | - |_ tools/ Verschiedene Scripts zum Importieren von Daten, Installation, Helper etc. - \_ tests/ Einfache Testcases für einige Klasses des Backends + |_ tools/ Verschiedene Scripts zum Importieren von Daten, Installation, Helper etc. + \_ tests/ Einfache Testcases für einige Klasses des Backends Wiki: http://wiki.volkszaehler.org Other: http://volkszaehler.org