Uploaded image for project: 'Help-Desk'
  1. Help-Desk
  2. HELP-13310

[fiware-stackoverflow] Modeling BD MYSQL Cygnus FIWARE

    Details

      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":

      { "type": "Float", "value": 9 }

      }
      }
      },
      {
      "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":

      { "type": "Float", "value": 9 }

      }
      }
      }
      ]

      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": [

      { "id": "palmerillas", "type": "invernadero" }

      ],
      "condition":

      { "attrs": [ "pressure2" ] }

      },
      "notification": {
      "timesSent": 2,
      "lastNotification": "2017-09-26T17:16:04.00Z",
      "attrs": [
      "temperature2",
      "pressure2",
      "sensor32",
      "sensor42"
      ],
      "attrsFormat": "legacy",
      "http":

      { "url": "http://localhost:5050/notify" }

      ,
      "lastSuccess": "2017-09-26T17:16:04.00Z"
      }
      },
      {
      "id": "59ca8bb94df7c75fee3e196a",
      "description": "A subscription to get info about palmerillas",
      "status": "active",
      "subject": {
      "entities": [

      { "id": "palmerillas2", "type": "invernadero2" }

      ],
      "condition":

      { "attrs": [ "pressure2" ] }

      },
      "notification": {
      "timesSent": 2,
      "lastNotification": "2017-09-26T17:17:56.00Z",
      "attrs": [
      "temperature2",
      "pressure2",
      "sensor32",
      "sensor42"
      ],
      "attrsFormat": "legacy",
      "http":

      { "url": "http://localhost:5050/notify" }

      ,
      "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

        Hide
        backlogmanager Backlog Manager added a comment -

        2018-01-12 19:50|CREATED monitor | # answers= 1, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2018-01-12 19:50|CREATED monitor | # answers= 1, accepted answer= False
        Hide
        backlogmanager Backlog Manager added a comment -

        2018-01-12 19:53|UPDATED status: transition Answer| # answers= 1, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2018-01-12 19:53|UPDATED status: transition Answer| # answers= 1, accepted answer= False
        Hide
        backlogmanager Backlog Manager added a comment -

        2018-01-12 20:02|UPDATED status: transition Answered| # answers= 1, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2018-01-12 20:02|UPDATED status: transition Answered| # answers= 1, accepted answer= False

          People

          • Assignee:
            backlogmanager Backlog Manager
            Reporter:
            backlogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: