Commit graph

7 commits

Author SHA1 Message Date
Daniel Collin
ea5c991824 Optimized data aggregation.
- All aggregation use only the raw data as input.
- Only produce aggregated data that will show in a chart (less work after clearing the sensor_data_aggr table).
- Adding version handling of data aggregation to secure that the peer has up to date data.
- New db version: 6 - Adding sensor.aggr_version(int, default=1), will clear sensor_data_aggr for local sensors


Former-commit-id: cbf5a890a5058791b443e975048db13f6ac4c9fe
2016-02-02 14:26:16 +01:00
2c59ae5693 Added event table and added ignored table to DB upgrade
Former-commit-id: 9237a2457630ac5fa1e41c7e6b16214ca24cba08
2016-01-04 19:21:26 +01:00
Daniel Collin
275ffd97c2 Adding logic to the batabase upgrade.
1. Introduced a new db table "db_version_history" to hal-default.db. The table contains a list of db version. Every version has some parameters:
- 'db-version' (int) - A db version number. table 'conf', key 'db_version' points to this.
- 'force-upgrade' (default:0) - If 1 then force the upgrade to this version
- 'clear-internal-aggr-data' (default:0) - If 1 then clear all internal aggr data before upgrade.
- 'clear-external-aggr-data' (defualt:0) - If 1 then clear all external aggr data before upgrade.
The db table 'conf', key 'db_version' has to point to the db version to upgrad to. Only forward upgrades are supported.

2. Modified HalContext to act accoring to the parameters in the new db table.


Former-commit-id: 19bd87ade3129f3fc0c51f0e1b94f71dc854d792
2015-12-21 14:09:51 +01:00
046aea1a2c External sensors are editable from web
Former-commit-id: 64343310cae1cbd1b14343f170ea7adc66d11671
2015-12-12 00:27:23 +01:00
3c763dbc2b DB upgrade implemented
Former-commit-id: 351a040593e4ddab880d517d9e0854d8c8815fb5
2015-12-08 22:25:14 +01:00
Ziver Koc
4ff6ae2b4c Added DB initialization logic and upgrade needed detection
Former-commit-id: 7a8b4d8157529a10c242ea995c0d2a4939b4d142
2015-12-07 22:42:55 +01:00
Ziver Koc
fdc9183c0c Changed DB access to a getter
Former-commit-id: 0eb743932c1bcd1e4fe9eba1d8485a54ae0b9db6
2015-12-07 21:48:13 +01:00