Skip to content
Snippets Groups Projects
Select Git revision
  • main
  • basic-running-container
2 results

database-service

  • Clone with SSH
  • Clone with HTTPS
  • Manuel Pitz's avatar
    Manuel Pitz authored
    The network from this docker-compose is only created when the repo is
    run in standalone mode.
    To reflect this, a new name has been given^
    07448263
    History

    Database Service (WIP)

    This repository is a part of the Open Energy Data Plattform If you are not actively developing the platform, clone this via the Open Energy Data Plattform repositoryc

    Database Structure

    Tables

    Device
    • device_id (AI, index)
    • UUID
    Attribute
    • device_id
    • parameter_id
    • value

    An attribute represents a key value pair assigned to a device. The device is specified by its id, the key specified as a parameter. Each attribute can be though of as a cell of a table

    Parameter
    • parameter_id (AI, index)
    • name
    • description

    A parameter represents a key in a key value pair (attribute) that can be assigned to a device. In a table, it can be though of as a column.

    Available Parameter types (Can be expanded)
    • created (timestamp)
    • updated (timestamp)
    • creator (id)
    • device_type (name)
    • location (lat_long)
    • street
    • country
    • city
    • postal_code
    • ch0_type
    • ch0_ratio
    • ch1_type
    • ch1_ratio
    • ch2_type
    • ch2_ratio
    • ch3_type
    • ch3_ratio
    • ch4_type
    • ch4_ratio
    • ch5_type
    • ch5_ratio
    • ch6_type
    • ch6_ratio
    • ch7_type
    • ch7_ratio
    Organisation
    • organization_id (AI, index)
    • name
    • street
    • city
    • postal_code

    This table handles all organizations. Each user belongs to an organization.

    User
    • user_id (AI, index)
    • organization_id
    • password_hash
    • role
    • first_name
    • last_name
    • mail
    • phone
    • street
    • city
    • postal_code

    This table is used to both store information about the users in the management system, as well as to authenticate access requests to the management UI and the database. JWT can be created for each one of the users.

    Usage

    Initializing (First start)

    You can specify the credentials by changing the variables in userdata.env

    MARIADB_USER=example-user
    MARIADB_PASSWORD=my_cool_secret
    MARIADB_ROOT_PASSWORD=my-secret-pw

    You can then run docker-compose up --build

    Make sure that no containers or volumes are still present from previous installations. (docker-compose down -v)

    During building (more specifically during the first run) the users are created and the database schema is imported.

    Starting

    You can start the DB & PhpMyAdmin using docker-compose up

    Stopping

    You can stop the DB & PhpMyAdmin using docker-compose stop or ctrl-c if not detached.

    This will not remove the volumes, the data stays persistent.

    Removing

    docker-compose down -v

    This will remove all networks and volumes. The data will be removed.

    Credits

    Funding acknowledgement

    European Flag GGSNS
    Co-funded by the European Union. Views and opinions expressed are however those of the author(s) only and do not necessarily reflect those of the European Union or the other granting authorities. Neither the European Union nor the granting authority can be held responsible for them. The TARGET-X project has received funding from the Smart Networks and Services Joint Undertaking (SNS JU) under the European Union's Horizon Europe research and innovation programme under Grant Agreement No: 101096614