Ghost/core/server/data/migrations/versions/3.29
Kevin Ansfield 490f9787fa
Added migration to create indexes and constraints for member tables (#12108)
no issue

For large numbers of members we're unable to perform queries for free/paid members in a reasonable time without indexes. Bulk delete is also very slow when looping through bookshelf models and having bookshelf manage deletion of child records, adding `ON DELETE CASCADE` to the foreign key indexes moves child deletion to the DB level and allows for performant bulk delete queries.

- migrations only run on mysql because sqlite does not support altering tables
- adds foreign key indexes and constraints with 'ON DELETE CASCADE' for members_labels, members_stripe_customers, and members_stripe_customers_subscriptions
2020-08-06 14:57:05 +02:00
..
01-remove-duplicate-subscriptions.js Cleaned up members_stripe_* tables on MySQL (#12103) 2020-08-06 11:13:41 +02:00
02-remove-duplicate-customers.js Cleaned up members_stripe_* tables on MySQL (#12103) 2020-08-06 11:13:41 +02:00
03-remove-orphaned-customers.js Cleaned up members_stripe_* tables on MySQL (#12103) 2020-08-06 11:13:41 +02:00
04-remove-orphaned-subscriptions.js Cleaned up members_stripe_* tables on MySQL (#12103) 2020-08-06 11:13:41 +02:00
05-add-member-constraints.js Added migration to create indexes and constraints for member tables (#12108) 2020-08-06 14:57:05 +02:00