Ghost/core/server/data/migrations/versions/4.0
Fabien 'egg' O'Carroll f4cb5c57c6
Updated members_status_events table (#12647)
refs https://github.com/TryGhost/Ghost/issues/12602

* Updated members_status_events table

By replacing the `status` column with a `from_status` and `to_status`
column, we are able to track the changes between multiple statuses
easier, and accumulate the data. e.g. the delta of paid members in a
given time range is the sum of the `to_status` columns set to 'paid'
minus the sum of the `from_status` columns set to 'paid' within that
time range

* Updated MEGA to handle addition of 'comped' status

With the addition of the 'comped' status, we need to ensure that MEGA
will still send emails to the correct recipients. I've opted to use an
"inverse" filter, as that is the intention of the free/paid split in
MEGA - as far as MEGA is concerned, "free" is the opposite of "paid"

* Updated customQuery for MemberStatusEvent

With the `status` column replaced with `from_status` and `to_status`
this allows us to fix and update the customQuery to correctly accumulate
the data into deltas over time, broken down by day.

* Populated members_status_events table

As the table will be used to generate deltas, we need to backfill the
data so that existing sites will be able to sum up the deltas and
calculate correct data.

The assumptions used in backfilling is that a Member's current status,
is their only status.
2021-02-16 10:38:36 +00:00
..
01-remove-not-null-constraint-from-plan-name-column.js Updated plan_nickname column to be nullable 2021-02-02 16:12:10 +00:00
02-add-status-column-to-members.js Added status property to members (#12570) 2021-02-02 16:11:34 +00:00
03-populate-status-column-for-members.js Updated status population to handle comped status (#12651) 2021-02-16 10:37:06 +00:00
04-drop-apps-related-tables.js 🏗 Dropped apps related tables 2021-02-03 12:20:08 +13:00
05-add-members-subscribe-events-table.js Added members_subscribe_events table 2021-02-05 16:02:08 +00:00
06-populate-members-subscribe-events-table.js Populated members_subscribe_events table 2021-02-05 16:02:08 +00:00
07-alter-unique-constraint-for-posts-slug.js 🏗 Altered slug unique constraint in posts table 2021-02-09 13:31:12 +13:00
08-add-members-login-events-table.js Added members event tables (#12618) 2021-02-11 10:54:30 +00:00
09-add-members-email-change-events-table.js Updated members_email_change_events to store previous email (#12641) 2021-02-12 16:15:31 +00:00
10-add-members-status-events-table.js Updated members_status_events table (#12647) 2021-02-16 10:38:36 +00:00
11-add-members-paid-subscription-events-table.js Updated members_paid_subscription_events table (#12636) 2021-02-11 12:45:18 +00:00
12-delete-apps-related-settings-keys.js Renamed duplicate migration 2021-02-11 11:02:18 +00:00
13-add-members-payment-events-table.js Added members event tables (#12618) 2021-02-11 10:54:30 +00:00
14-populate-members-paid-subscription-events-table.js Populated members_paid_subscription_events table 2021-02-12 13:55:14 +00:00
15-add-frontmatter-column-to-meta.js Added the frontmatter column to meta 2021-02-12 15:31:04 +01:00
16-refactor-slack-setting.js Refactored usage of the pre v4 "slack" setting 2021-02-15 15:25:54 +13:00
17-populate-members-status-events-table.js Updated members_status_events table (#12647) 2021-02-16 10:38:36 +00:00