0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00
ghost/core/server/data/migrations/versions
Matt Hanley d4700e048a Mapped subscribers to newsletter (#14518)
Closes https://github.com/TryGhost/Team/issues/1508
Refs https://github.com/TryGhost/Ghost/pull/14468

- Maps existing subscribers to the default newsletter

A note on performance:
We loop over the rows in a potentially large table (members) but I've minimised the impact by limiting the columns we fetch. The alternative is a raw SQL query like the one below: the SQL version takes ~0.9s vs ~1.1s for the migration (my laptop, ~30k members). The disadvantage of the raw SQL implementation is the approximation of the ObjectID (instead of a legit bson ID) which isn't sequential and may impact index size/performance.

```sql
insert into members_newsletters (id, member_id, newsletter_id)
    select
        substr(replace(uuid(),'-',''),1,24),
        id,
        '62595dcbfad4e031d85d166f'
    from members
    where members.subscribed=true;
```
2022-04-26 12:31:34 +01:00
..
1.3
1.4
1.5
1.7
1.9
1.13
1.18
1.19
1.20
1.21 Refactored fixtures to be loaded by fixture manager 2021-11-16 11:17:03 +00:00
1.22
1.25 Added lint rules for migrations 2021-11-29 16:21:43 +00:00
2.0
2.2 Refactored fixtures to be loaded by fixture manager 2021-11-16 11:17:03 +00:00
2.3
2.6
2.8
2.13
2.14
2.15 Refactored fixtures to be loaded by fixture manager 2021-11-16 11:17:03 +00:00
2.16
2.17
2.18
2.21
2.22
2.27 Refactored fixtures to be loaded by fixture manager 2021-11-16 11:17:03 +00:00
2.28 Refactored fixtures to be loaded by fixture manager 2021-11-16 11:17:03 +00:00
2.29
2.31
2.32
2.33
2.34
2.35
2.37
3.0
3.1 Added lint rules for migrations 2021-11-29 16:21:43 +00:00
3.2
3.6
3.7
3.8
3.9
3.11
3.12
3.18
3.19
3.22 Added lint rules for migrations 2021-11-29 16:21:43 +00:00
3.23 Added lint rules for migrations 2021-11-29 16:21:43 +00:00
3.24
3.25
3.26
3.29 Switched to util for retrieving DB info in migrations 2022-03-02 15:05:55 +01:00
3.30
3.32
3.33
3.34
3.35
3.36
3.37
3.38 Added lint rules for migrations 2021-11-29 16:21:43 +00:00
3.39 Switched to util for retrieving DB info in migrations 2022-03-02 15:05:55 +01:00
3.40
3.41
4.0 Switched to util for retrieving DB info in migrations 2022-03-02 15:05:55 +01:00
4.1 Switched to util for retrieving DB info in migrations 2022-03-02 15:05:55 +01:00
4.2
4.3 Added lint rules for migrations 2021-11-29 16:21:43 +00:00
4.4 Added lint rules for migrations 2021-11-29 16:21:43 +00:00
4.5
4.6 Added lint rules for migrations 2021-11-29 16:21:43 +00:00
4.7
4.8 Added lint rules for migrations 2021-11-29 16:21:43 +00:00
4.9 Added lint rules for migrations 2021-11-29 16:21:43 +00:00
4.11
4.12 Added lint rules for migrations 2021-11-29 16:21:43 +00:00
4.13
4.14 Added lint rules for migrations 2021-11-29 16:21:43 +00:00
4.15
4.16
4.17
4.19 Prefixed migration with 01 2021-10-13 17:37:39 +02:00
4.20 Switched to util for retrieving DB info in migrations 2022-03-02 15:05:55 +01:00
4.22 Moved launchComplete user setting as global editor setting (#13703) 2021-11-04 18:03:51 +05:30
4.23 Added lint rules for migrations 2021-11-29 16:21:43 +00:00
4.33 Added note for using id as slug for free tier 2022-03-11 18:08:47 +05:30
4.34 Added welcome_page_url column to products table 2022-01-26 11:44:40 +02:00
4.35 Switched to util for retrieving DB info in migrations 2022-03-02 15:05:55 +01:00
4.36 Added the last_seen_at column to members 2022-02-09 11:57:45 +01:00
4.37 Switched to util for retrieving DB info in migrations 2022-03-02 15:05:55 +01:00
4.38 Switched products.visible for products.visibility (#14264) 2022-03-04 11:07:38 +00:00
4.39 Migrated visibility column from portal settings (#14253) 2022-03-07 11:38:39 +00:00
4.40 Enabled Admin integration for tiers and offers API (#14325) 2022-03-16 16:46:26 +05:30
4.42 Updated migration eslint rule to catch bad filenames 2022-04-05 11:50:39 +01:00
4.43 Fixed newsletter schema column validation (#14456) 2022-04-11 15:05:02 +05:30
4.44 Added offer_id column to members_stripe_customers_subscriptions (#14487) 2022-04-15 13:47:15 +02:00
4.45 Added version_notifications key to settings table 2022-04-21 20:34:19 +08:00
4.46 Mapped subscribers to newsletter (#14518) 2022-04-26 12:31:34 +01:00