Sbef98 / IOT

A led is enough somtimes
Apache License 2.0
0 stars 1 forks source link

Initializing a bridge deletes the database #15

Open Paula-Kli opened 2 years ago

Paula-Kli commented 2 years ago

For sensors and actuators the database gets deleted when initializing a bridge with an id that was seen before. In that way we do not risk assosiziating non existing sensors with a bridge which might have different and new sensors and actuators.

At the moment the sensorfeeds do not get deleted by cascade which might be good to store the data for later or bad since we do not know which datatype the values have if we delete the assoziated sensor value in the database. But the bridge will initialize all the sensor again anyways. (it also prevents us from overflowing and getting ids higher than 253 after initializing the same bridge several times see also #14

Paula-Kli commented 2 years ago

Update from https://github.com/Sbef98/IOT/commit/6a94887a8b7b24252179f307792cecd6b871e539 : we delete the sensorfeeds since postgresql does not allow them to stay but it happens manually and not by the database cascade