Add "updated_at" and "created_at" columns to the observations table #1685
-
On some of our non-FROST-Server databases, we have tables where we've added "created_at" and "updated_at" columns to help us discern when rows were created vs. when they were last updated. Each time data is written to a row or when a row is added, a postgres trigger updates a timestamp in the column. This allows us to quickly tell exactly when rows in a given time series have been updated for troubleshooting and testing purposes. Is there a similar mechanism in the FROST-Server database? It would help us troubleshoot our data. If there is not such a mechanism, is there a way you would recommend adding this to our database ourselves? Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Frost doesn't have this functionality itself, but it is not that hard to add using the ModelLoader plugin. Two examples of using the ModelLoader plugin to extend the FROST data model are:
The plugin can load extra Liquibase files to modify the database and add those two columns and triggers. Modifications to the data model can be specified with JSON files. This specific example adds a Ideally you'd also add a link to the conformance class list, documenting your data model changes. |
Beta Was this translation helpful? Give feedback.
Frost doesn't have this functionality itself, but it is not that hard to add using the ModelLoader plugin.
Two examples of using the ModelLoader plugin to extend the FROST data model are:
The plugin can load extra Liquibase files to modify the database and add those two columns and triggers. Modifications to the data model can be specified with JSON files. This specific example adds a
sensorType
field to the Sensor entity type.Ideally you'd also add a link to the conformance class list, documenting your data model changes.