endlessm / azafea

Service to track device activations and usage metrics
Mozilla Public License 2.0
10 stars 2 forks source link

Store machine location into metrics_machine table #134

Closed liZe closed 3 years ago

liZe commented 3 years ago

Instead of storing machine location in events, we can store it in the metrics_machine table and upsert when new events happen.

The deployment creates the new columns and sets the values according to the events already stored in the database.

The event table is not removed yet. This way, we can check that everything is OK for a while, and keep events if anything goes wrong.

This is the first step of https://phabricator.endlessm.com/T30471.

liZe commented 3 years ago

The deployment probably needs to be carefully tested on a dev database before. I’ve launched the request on the production database using a temporary table, I think that it works, but I would be much more confident if the real deployment was tested with production data.

liZe commented 3 years ago

The deployment probably needs to be carefully tested on a dev database before. I’ve launched the request on the production database using a temporary table, I think that it works, but I would be much more confident if the real deployment was tested with production data.

@wjt I’ve updated the SQL request to update metrics_machine.location too. It would be great to test the whole deployment on real and manually check the result, before deploying on production.

liZe commented 3 years ago

It would be great to test the whole deployment on real and manually check the result, before deploying on production.

I’ve deployed the migration on a testing database, everything’s fine. :tada: