Files
notifications-api/database_maintenance
Rebecca Law 46e92dae13 Update with timings.
This branch is likely to be closed as we can more easily perform an upgrade than cycle the notification_history table.
2020-05-06 14:27:21 +01:00
..
2020-05-06 14:27:21 +01:00

Create a new app to test command

DO NOT commit new manifest file

Add to MakeFile 'notify-cycle-history': { 'NOTIFY_APP_NAME': 'api', 'instances': { 'preview': 0, 'staging': 0, 'production': 0 }, },

CF_APP=notify-cycle-history CF_SPACE=staging make generate-manifest > cycle-history-manifest.yml cf v3-create-app notify-cycle-history cf v3-apply-manifest -f cycle-history-manifest.yml cf v3-push notify-cycle-history

cf run-task notify-cycle-history "flask command cycle-notification-history-table -l 100000 -s '2020-03-18 00:00' -e '2020-03-19 00:00"

  • Deploy new command - cycle_notification_history_table to prod
  • script_1.sql
    • create nh_pivot
    • create nh trigger
    • create new index on nh
  • foreign_keys.sql
  • run command for each day in nh --> start October 1, 2019 -- all data in NH

2020-05-05T14:35:47.18+0100 [APP/TASK/6a5ea53b/0] OUT Starting cycle notification history for start_date: 2020-03-19 00:00:00 and end_date 2020-03-29 00:00:00 and limit: 100000 2020-05-05T14:41:21.16+0100 [APP/TASK/6a5ea53b/0] OUT rows_remaining: 67800240 2020-05-06T02:48:36.84+0100 [APP/TASK/6a5ea53b/0] OUT End cycle notification history: 2020-05-06 01:48:36.849611

5,650,020