Merge branch 'master' of github.com:volkszaehler/volkszaehler.org
This commit is contained in:
commit
b9979b66cd
5 changed files with 21351 additions and 24 deletions
|
@ -4,15 +4,7 @@ To setup your database follow these steps:
|
|||
|
||||
1. Make sure you have a proper configuration file (backend/volkszaehler.conf.php)
|
||||
2. Adjust the configuration to your database setup
|
||||
3. Call backend/bin/doctrine orm:schema-tool:create
|
||||
3. Call backend/bin/doctrine orm:schema-tool:create --dump-sql > share/sql/mysql.sql
|
||||
4. import the resulting file using your favorite sql tool
|
||||
|
||||
Alternative way:
|
||||
|
||||
This folder contains some SQL dumps which can be imported in your database.
|
||||
Be aware that these dumps can be outdated!
|
||||
|
||||
These dumps are generated with doctrine schema-tool:
|
||||
|
||||
backend/bin/doctrine orm:schema-tool:create --dump-sql > share/sql/mysql.sql
|
||||
|
||||
[1] http://www.doctrine-project.org
|
||||
[1] http://www.doctrine-project.org
|
||||
|
|
21345
share/sql/demo/data-demoset1.sql
Normal file
21345
share/sql/demo/data-demoset1.sql
Normal file
File diff suppressed because it is too large
Load diff
|
@ -22,10 +22,10 @@ SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
|
|||
CREATE TABLE IF NOT EXISTS `properties` (
|
||||
`id` smallint(6) NOT NULL AUTO_INCREMENT,
|
||||
`entity_id` smallint(6) DEFAULT NULL,
|
||||
`key` varchar(255) NOT NULL,
|
||||
`pkey` varchar(255) NOT NULL,
|
||||
`value` varchar(255) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `unique_properties` (`id`,`key`),
|
||||
UNIQUE KEY `unique_properties` (`id`,`pkey`),
|
||||
KEY `entity_id` (`entity_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=15 ;
|
||||
|
||||
|
@ -33,7 +33,7 @@ CREATE TABLE IF NOT EXISTS `properties` (
|
|||
-- Daten für Tabelle `properties`
|
||||
--
|
||||
|
||||
INSERT INTO `properties` (`id`, `entity_id`, `key`, `value`) VALUES
|
||||
INSERT INTO `properties` (`id`, `entity_id`, `pkey`, `value`) VALUES
|
||||
(1, 1, 'title', 'S0-Zaehler'),
|
||||
(2, 1, 'description', 'Nummer 1'),
|
||||
(4, 1, 'resolution', '2000'),
|
||||
|
|
Binary file not shown.
|
@ -1,10 +0,0 @@
|
|||
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)
|
Loading…
Add table
Reference in a new issue