Details
-
Type: Monitor
-
Status: Closed
-
Priority: Major
-
Resolution: Done
-
Affects Version/s: None
-
Fix Version/s: 2021
-
Component/s: FIWARE-TECH-HELP
-
Labels:
-
HD-Chapter:Data
-
HD-Enabler:Cygnus
Description
Created question in FIWARE Q/A platform on 26-09-2017 at 22:09
Please, ANSWER this question AT https://stackoverflow.com/questions/46435336/modeling-bd-mysql-cygnus-fiware
Question:
Modeling BD MYSQL Cygnus FIWARE
Description:
I am trying to model my DB in MYSQL, I would like my structure to be formed by a data collection table, which would be the one that generates cygnus automatically, then its subsequent related tables for those data with greenhouses and users.
All the data of all the sensors of each users in a table and then relate this to each user and greenhouse, I think it would be the correct way.
But I'm trying to create two subscriptions one that meta data in this table for an entity ID and another for another entity ID, but it automatically creates me two tables and the idea is to be all in one.
How could this be done?
I attach my entities:
GET /v2/entities/ HTTP/1.1
Host: 1.2.3.4:1026
Accept: application/json
Content-Type: application/json
Fiware-Service: pruebastienda
Fiware-ServicePath: /tienda1
Cache-Control: no-cache
Postman-Token: e19de386-ca21-cd7d-cd24-f1dee9487196
[
{
"id": "palmerillas",
"type": "invernadero",
"pressure2": {
"type": "Integer",
"value": 6,
"metadata": {}
},
"sensor32": {
"type": "Integer",
"value": 1,
"metadata": {}
},
"sensor42": {
"type": "Integer",
"value": 44,
"metadata": {}
},
"temperature2": {
"type": "float",
"value": 4,
"metadata": {
"accuracy":
}
}
},
{
"id": "palmerillas2",
"type": "invernadero2",
"pressure2": {
"type": "Integer",
"value": 6,
"metadata": {}
},
"sensor32": {
"type": "Integer",
"value": 1,
"metadata": {}
},
"sensor42": {
"type": "Integer",
"value": 44,
"metadata": {}
},
"temperature2": {
"type": "float",
"value": 4,
"metadata": {
"accuracy":
}
}
}
]
And my subscriptions as well:
GET /v2/subscriptions/ HTTP/1.1
Host: 1.2.3.4:1026
Accept: application/json
Fiware-Service: pruebastienda
Fiware-ServicePath: /tienda1
Cache-Control: no-cache
Postman-Token: 7898a397-2018-42fc-7edf-e35f25105901
[
{
"id": "59ca8b394df7c75fee3e1969",
"description": "A subscription to get info about palmerillas",
"status": "active",
"subject": {
"entities": [
],
"condition":
},
"notification": {
"timesSent": 2,
"lastNotification": "2017-09-26T17:16:04.00Z",
"attrs": [
"temperature2",
"pressure2",
"sensor32",
"sensor42"
],
"attrsFormat": "legacy",
"http":
,
"lastSuccess": "2017-09-26T17:16:04.00Z"
}
},
{
"id": "59ca8bb94df7c75fee3e196a",
"description": "A subscription to get info about palmerillas",
"status": "active",
"subject": {
"entities": [
],
"condition":
},
"notification": {
"timesSent": 2,
"lastNotification": "2017-09-26T17:17:56.00Z",
"attrs": [
"temperature2",
"pressure2",
"sensor32",
"sensor42"
],
"attrsFormat": "legacy",
"http":
,
"lastSuccess": "2017-09-26T17:17:56.00Z"
}
}
]
EDIT:
The names of the tables are:
tienda1_palmerillas_invernadero AND tienda1_palmerillas2_invernadero2
as you can see in the picture
Activity
Transition | Time In Source Status | Execution Times | Last Executer | Last Execution Date | |||||
---|---|---|---|---|---|---|---|---|---|
|
3m 19s | 1 | Backlog Manager | 12/Jan/18 7:53 PM | |||||
|
8m 55s | 1 | Backlog Manager | 12/Jan/18 8:02 PM | |||||
|
12d 11h 34m | 1 | José Ignacio Carretero Guarde | 25/Jan/18 7:37 AM |