-
146 schema migration (spaces cluster) safe to run
-
147 schema migration (metric_key_id) safe to run took 10min on stage
-
148 schema migration (metric_key_name_id, also metric_key_id FK) safe to run took 1528s on stage
Per space part:
-
036 data migration (metric_key_names metric_key_id) run per space took 1536s on stage for 5147 for 75836 records make index and then it will be faster
-
037 data migration run per space took 2.4s on stage for 5147 for 75836 records that was with index
All of the above were already done. Now the actual per space release part:
- Create new space on
anita
cluster using https://databox.slack.com/archives/CB05GH33R/p1531226404000265 - Enable maintenance mode on push API
- Enable maintenance mode on calculations
- Switch cluster to
anita
inspaces
prod database - Clear redis cache for that space (https://github.com/databox/calculations/blob/develop/README.md)
curl -H "Content-Type: application/json" -X DELETE http://localhost:8001/spaces/cache/{id}
- Disable maintenance mode on calculations
- Disable maintenance mode on push API
- trigere treba skreirat na WH tabeli ko se prek kopira
- cascade delete na metric_key_names (boris more še vse v migracijo dodat kot sma se zmenla)
- ENV variabla na kalkulacije ko se deployajo (LOOKUP_SCHEMA)
- pray
- FK constraint on metric_key_names was dropped after migration finished. It will (and must) be added when all metric_key_names have their respective metric_key_id. And then cascade delete must be added. So
ALTER TABLE metric_key_names ADD CONSTRAINT fk_metric_key_names FOREIGN KEY (metric_key_id) REFERENCES metric_keys(metric_key_id);
Must also include on delete cascade.