Ghost/core/server/models
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
..
base Added unique constraint notation to schema definition 2021-02-04 13:37:20 +13:00
plugins Added email.open_rate order option to posts api (#12439) 2020-12-03 20:13:37 +00:00
relations Extracted promise libs and history into @tryghost/promise 2020-08-11 18:44:21 +01:00
action.js Added model implementation for actions 2019-02-06 21:36:09 +01:00
api-key.js Added the user_id field to the api_keys table 2020-11-20 09:53:18 +01:00
author.js Added plugin based author and public tag models in API v2 (#10284) 2019-01-03 20:30:35 +01:00
email-batch.js Fixed creation of EmailBatch and EmailRecipient collections 2020-10-14 15:11:45 +01:00
email-recipient.js Removed unnecessary bookshelf-relations config in EmailRecipient model 2021-01-05 15:28:30 +00:00
email.js Added migrations for email analytics (#12387) 2020-11-25 17:48:24 +00:00
index.js Added MemberPaidSubscriptionEvent model 2021-02-12 13:55:14 +00:00
integration.js Ensured Admin API cannot fetch internal integrations (#10501) 2019-07-24 11:52:55 +02:00
invite.js Extracted core/server/lib/security to @tryghost/security package 2020-08-11 14:06:50 +01:00
label.js Refactored common lib import to use destructuring (#11835) 2020-05-22 19:22:20 +01:00
member-email-change-event.js Added MemberEmailChangeEvent model 2021-02-12 13:55:14 +00:00
member-login-event.js Added MemberLoginEvent model 2021-02-12 13:55:14 +00:00
member-paid-subscription-event.js Added MemberPaidSubscriptionEvent model 2021-02-12 13:55:14 +00:00
member-payment-event.js Fixed incorrect volume delta selection in query 2021-02-16 11:18:58 +05:30
member-status-event.js Updated members_status_events table (#12647) 2021-02-16 10:38:36 +00:00
member-stripe-customer.js Added error handling for failed member imports 2020-08-26 17:11:35 +12:00
member-subscribe-event.js Added missing semicolon 2021-02-10 10:14:29 +00:00
member.js 🐛 Fixed Member model removing labels when unset 2021-02-08 09:39:46 +00:00
mobiledoc-revision.js Added mobiledoc revisions functionality 2018-10-09 15:31:09 +02:00
permission.js Updated var declarations to const/let and no lists 2020-04-29 16:51:13 +01:00
post.js Enabled Members for all sites (#12582) 2021-02-02 16:12:53 +00:00
posts-meta.js Moved core/server/lib/url-utils to core/shared/url-utils (#11856) 2020-05-28 11:57:02 +01:00
role.js Refactored common lib import to use destructuring (#11835) 2020-05-22 19:22:20 +01:00
session.js Removed user_id constraint when upserting session (#10085) 2018-10-30 16:15:48 +07:00
settings.js Fixed settings validation error not distinguishing between publishable/secret keys 2021-02-03 16:42:51 +00:00
single-use-token.js 🐛 Added multiple use grace period to tokens (#12519) 2021-01-18 17:03:41 +00:00
snippet.js Added basic CRUD admin API for snippets 2020-10-16 18:02:58 +01:00
stripe-customer-subscription.js Included cancellation_reason in subscription serialization (#12411) 2020-11-23 21:19:27 +00:00
tag-public.js Added plugin based author and public tag models in API v2 (#10284) 2019-01-03 20:30:35 +01:00
tag.js Refactored common lib import to use destructuring (#11835) 2020-05-22 19:22:20 +01:00
user.js Added the user_id field to the api_keys table 2020-11-20 09:53:18 +01:00
webhook.js Updated var declarations to const/let and no lists 2020-04-29 16:51:13 +01:00