Ghost/core/server/data/migrations/versions
Fabien 'egg' O'Carroll a0a35df13b
Migrated members comped status to reflect subscriptions (#13285)
* Migrated members comped status to reflect subscriptions

refs https://github.com/TryGhost/Team/issues/995

Due to a bug in subscription handling, members with Complimentary stripe
subscriptions were incorrectly given a status of 'paid'.

The goal of this migration is to fix existing broken members, and it
will be accompanied by a fix which prevents the bug for future members.

Since we are updating the status properties for members, we must ensure
that we also update the relevant member_status_events entries too, so
that we do not have incompatible sums between events and statuses.

For example, if we were to use events to graph comped members over time,
we would want the current count to match the query on statuses:

`SELECT COUNT(*) FROM members WHERE status='comped';`
2021-09-06 18:56:44 +02:00
..
1.3 Refactored 'add column' migrations to use helper 2020-11-25 13:56:10 +00:00
1.4 Refactored 'add column' migrations to use helper 2020-11-25 13:56:10 +00:00
1.5 Refactored 'add column' migrations to use helper 2020-11-25 13:56:10 +00:00
1.7 Removed all clients and client_trusted_domains related code 2019-09-12 15:09:49 +01:00
1.9 Updated ALL permissions migrations to use the utils 2020-06-25 19:15:25 +02:00
1.13 Refactored 'add column' migrations to use helper 2020-11-25 13:56:10 +00:00
1.18 Refactored 'add table' migrations to use helper 2020-11-25 13:56:10 +00:00
1.19 Updated ALL permissions migrations to use the utils 2020-06-25 19:15:25 +02:00
1.20 Change to use @tryghost/logging 2021-06-15 15:59:11 +01:00
1.21 Change to use @tryghost/logging 2021-06-15 15:59:11 +01:00
1.22 Change to use @tryghost/logging 2021-06-15 15:59:11 +01:00
1.25 Change to use @tryghost/logging 2021-06-15 15:59:11 +01:00
2.0 Change to use @tryghost/logging 2021-06-15 15:59:11 +01:00
2.2 Change to use @tryghost/logging 2021-06-15 15:59:11 +01:00
2.3 Refactored 'add column' migrations to use helper 2020-11-25 13:56:10 +00:00
2.6 Updated ALL permissions migrations to use the utils 2020-06-25 19:15:25 +02:00
2.8 Refactored 'add table' migrations to use helper 2020-11-25 13:56:10 +00:00
2.13 💡Reverted "empty-string to NULL" db migration (#10430) 2019-01-29 14:41:04 +00:00
2.14 Refactored 'add table' migrations to use helper 2020-11-25 13:56:10 +00:00
2.15 Change to use @tryghost/logging 2021-06-15 15:59:11 +01:00
2.16 Removed 2.16 member permission migration 2019-05-02 17:31:38 +02:00
2.17 Change to use @tryghost/logging 2021-06-15 15:59:11 +01:00
2.18 Moved settings/cache to shared/settings-cache 2021-06-30 15:49:10 +01:00
2.21 Updated ALL permissions migrations to use the utils 2020-06-25 19:15:25 +02:00
2.22 Updated ALL permissions migrations to use the utils 2020-06-25 19:15:25 +02:00
2.27 Change to use @tryghost/logging 2021-06-15 15:59:11 +01:00
2.28 Change to use @tryghost/logging 2021-06-15 15:59:11 +01:00
2.29 Change to use @tryghost/logging 2021-06-15 15:59:11 +01:00
2.31 Refactored column migrations to use helpers (#12360) 2020-11-16 11:55:51 +00:00
2.32 Refactored column migrations to use helpers (#12360) 2020-11-16 11:55:51 +00:00
2.33 Change to use @tryghost/logging 2021-06-15 15:59:11 +01:00
2.34 Refactored 'add table' migrations to use helper 2020-11-25 13:56:10 +00:00
2.35 Refactored column migrations to use helpers (#12360) 2020-11-16 11:55:51 +00:00
2.37 Change to use @tryghost/logging 2021-06-15 15:59:11 +01:00
3.0 Removed use of deprecated new Error() syntax 2021-07-14 12:16:44 +04:00
3.1 Change to use @tryghost/logging 2021-06-15 15:59:11 +01:00
3.2 Refactored column migrations to use helpers (#12360) 2020-11-16 11:55:51 +00:00
3.6 Refactored 'add table' migrations to use helper 2020-11-25 13:56:10 +00:00
3.7 Change to use @tryghost/logging 2021-06-15 15:59:11 +01:00
3.8 Refactored column migrations to use helpers (#12360) 2020-11-16 11:55:51 +00:00
3.9 Updated ALL permissions migrations to use the utils 2020-06-25 19:15:25 +02:00
3.11 Switch to @tryghost/debug, remove ghost-ignition 2021-06-15 17:24:22 +01:00
3.12 Switch to @tryghost/debug, remove ghost-ignition 2021-06-15 17:24:22 +01:00
3.18 Updated ALL permissions migrations to use the utils 2020-06-25 19:15:25 +02:00
3.19 Switch to @tryghost/debug, remove ghost-ignition 2021-06-15 17:24:22 +01:00
3.22 Change to use @tryghost/logging 2021-06-15 15:59:11 +01:00
3.23 Change to use @tryghost/logging 2021-06-15 15:59:11 +01:00
3.24 Change to use @tryghost/logging 2021-06-15 15:59:11 +01:00
3.25 Change to use @tryghost/logging 2021-06-15 15:59:11 +01:00
3.26 Change to use @tryghost/logging 2021-06-15 15:59:11 +01:00
3.29 Change to use @tryghost/logging 2021-06-15 15:59:11 +01:00
3.30 Granted Admin users ability to impersonate member (#12132) 2020-08-18 14:17:56 +05:30
3.32 Change to use @tryghost/logging 2021-06-15 15:59:11 +01:00
3.33 Refactored 'add table' migrations to use helper 2020-11-25 13:56:10 +00:00
3.34 Added tokens table to the database 2020-09-17 16:08:35 +01:00
3.35 Refactored column migrations to use helpers (#12360) 2020-11-16 11:55:51 +00:00
3.36 Added snippets permissions migration and fixtures (#12283) 2020-10-16 12:53:09 +01:00
3.37 Change to use @tryghost/logging 2021-06-15 15:59:11 +01:00
3.38 Change to use @tryghost/logging 2021-06-15 15:59:11 +01:00
3.39 Change to use @tryghost/logging 2021-06-15 15:59:11 +01:00
3.40 Change to use @tryghost/logging 2021-06-15 15:59:11 +01:00
3.41 Change to use @tryghost/logging 2021-06-15 15:59:11 +01:00
4.0 Removed use of deprecated new Error() syntax 2021-07-19 21:31:31 +12:00
4.1 Change to use @tryghost/logging 2021-06-15 15:59:11 +01:00
4.2 Change to use @tryghost/logging 2021-06-15 15:59:11 +01:00
4.3 Change to use @tryghost/logging 2021-06-15 15:59:11 +01:00
4.4 Moved settings/cache to shared/settings-cache 2021-06-30 15:49:10 +01:00
4.5 Change to use @tryghost/logging 2021-06-15 15:59:11 +01:00
4.6 Change to use @tryghost/logging 2021-06-15 15:59:11 +01:00
4.7 Change to use @tryghost/logging 2021-06-15 15:59:11 +01:00
4.8 Moved the "Reset all passwords" permission migration to Ghost 4.9 2021-06-23 17:08:44 +02:00
4.9 Migrated members_status_events for comped members 2021-07-06 12:00:03 +01:00
4.11 Added email disabling flag to settings records 2021-07-29 20:30:30 +12:00
4.12 Fixed existing members status properties 2021-08-13 11:39:19 +02:00
4.13 Gave Administrators permission to connect to Stripe (#13228) 2021-08-26 11:00:40 +01:00
4.14 Migrated members comped status to reflect subscriptions (#13285) 2021-09-06 18:56:44 +02:00