Ghost/core/server/data/migrations/versions
Fabien 'egg' O'Carroll d3384975da
Cleaned up members_stripe_* tables on MySQL (#12103)
refs #12100

For performance reasons we want to add foreign key and unique constraints
to the members_stripe_* tables so we can utilised cascading deletes and 
joins across the tables when querying.

In order to do this we must first ensure that:
- There are no duplicate entries in the `subscription_id` or `customer_id` columns
- There are no orphaned rows in the subscription or customers tables

If the first is not true, the unique constraint will fail, and if the second is not true,
the foreign key constraint will fail.

As we are only adding the indexes to existing MySQL databases at this point, the
cleanup migrations will also only be done for existing MySQL databases too.

The migrations for removing orphaned rows splits the deletion into a `SELECT`
followed by a `WHERE IN` to avoid the database "optimising" the query into a
`JOIN` which ends up taking much longer due to the lack of indexes.
2020-08-06 11:13:41 +02:00
..
1.3 Moved core/server/lib/common/logging to core/shared/logging (#11857) 2020-05-28 19:30:23 +01:00
1.4 Moved core/server/lib/common/logging to core/shared/logging (#11857) 2020-05-28 19:30:23 +01:00
1.5 Moved core/server/lib/common/logging to core/shared/logging (#11857) 2020-05-28 19:30:23 +01: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 Updated ALL permissions migrations to use the utils 2020-06-25 19:15:25 +02:00
1.18 Moved core/server/lib/common/logging to core/shared/logging (#11857) 2020-05-28 19:30:23 +01:00
1.19 Updated ALL permissions migrations to use the utils 2020-06-25 19:15:25 +02:00
1.20 Moved core/server/lib/common/logging to core/shared/logging (#11857) 2020-05-28 19:30:23 +01:00
1.21 Moved core/server/lib/common/logging to core/shared/logging (#11857) 2020-05-28 19:30:23 +01:00
1.22 Moved core/server/lib/common/logging to core/shared/logging (#11857) 2020-05-28 19:30:23 +01:00
1.25 Moved core/server/lib/common/logging to core/shared/logging (#11857) 2020-05-28 19:30:23 +01:00
2.0 Moved core/server/lib/common/logging to core/shared/logging (#11857) 2020-05-28 19:30:23 +01:00
2.2 Updated ALL permissions migrations to use the utils 2020-06-25 19:15:25 +02:00
2.3 Updated ALL permissions migrations to use the utils 2020-06-25 19:15:25 +02:00
2.6 Updated ALL permissions migrations to use the utils 2020-06-25 19:15:25 +02:00
2.8 Moved core/server/lib/common/logging to core/shared/logging (#11857) 2020-05-28 19:30:23 +01:00
2.13 💡Reverted "empty-string to NULL" db migration (#10430) 2019-01-29 14:41:04 +00:00
2.14 Updated ALL permissions migrations to use the utils 2020-06-25 19:15:25 +02:00
2.15 Moved core/server/lib/common/logging to core/shared/logging (#11857) 2020-05-28 19:30:23 +01:00
2.16 Removed 2.16 member permission migration 2019-05-02 17:31:38 +02:00
2.17 Moved core/server/lib/common/logging to core/shared/logging (#11857) 2020-05-28 19:30:23 +01:00
2.18 Moved core/server/lib/common/logging to core/shared/logging (#11857) 2020-05-28 19:30:23 +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 Moved core/server/lib/common/logging to core/shared/logging (#11857) 2020-05-28 19:30:23 +01:00
2.28 Updated ALL permissions migrations to use the utils 2020-06-25 19:15:25 +02:00
2.29 Moved core/server/lib/common/logging to core/shared/logging (#11857) 2020-05-28 19:30:23 +01:00
2.31 Removed name and password columns from members table 2019-09-05 11:14:50 +08:00
2.32 🐛 Fixed error when during migration to 2.32.0 on mysql (#11208) 2019-10-08 11:07:29 +01:00
2.33 Moved core/server/lib/common/logging to core/shared/logging (#11857) 2020-05-28 19:30:23 +01:00
2.34 Moved core/server/lib/common/logging to core/shared/logging (#11857) 2020-05-28 19:30:23 +01:00
2.35 Added migration for note column on members table 2019-10-10 17:51:46 +07:00
2.37 Moved core/server/lib/common/logging to core/shared/logging (#11857) 2020-05-28 19:30:23 +01:00
3.0 Moved core/server/lib/common/logging to core/shared/logging (#11857) 2020-05-28 19:30:23 +01:00
3.1 Updated ALL permissions migrations to use the utils 2020-06-25 19:15:25 +02:00
3.2 Added member's subscription cancellation helper {{cancel_link}} (#11434) 2019-12-12 19:59:15 +07:00
3.6 Updated ALL permissions migrations to use the utils 2020-06-25 19:15:25 +02:00
3.7 Moved core/server/lib/common/logging to core/shared/logging (#11857) 2020-05-28 19:30:23 +01:00
3.8 Added migration to add members.geolocation 2020-02-22 10:12:06 +00:00
3.9 Updated ALL permissions migrations to use the utils 2020-06-25 19:15:25 +02:00
3.11 Moved core/server/lib/common/logging to core/shared/logging (#11857) 2020-05-28 19:30:23 +01:00
3.12 Updated ALL permissions migrations to use the utils 2020-06-25 19:15:25 +02:00
3.18 Updated ALL permissions migrations to use the utils 2020-06-25 19:15:25 +02:00
3.19 Added migration updating members from address with domain 2020-06-08 23:47:02 +05:30
3.22 Hardened members subscription migration against missing data (#12009) 2020-07-06 12:18:13 +02:00
3.23 Added new meta columns to tags table 2020-07-08 11:49:22 +02:00
3.24 Added migration to update group for new portal settings 2020-07-10 18:32:54 +05:30
3.25 Fixed version for amp_gtag_id setting migration 2020-07-15 15:33:37 +02:00
3.26 Fixed version for amp_gtag_id setting migration 2020-07-15 15:33:37 +02:00
3.29 Cleaned up members_stripe_* tables on MySQL (#12103) 2020-08-06 11:13:41 +02:00