mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-07 03:22:21 +03:00
d4700e048a
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; ``` |
||
---|---|---|
.. | ||
adapters | ||
api | ||
data | ||
lib | ||
models | ||
services | ||
views | ||
web | ||
analytics-events.js | ||
ghost-server.js | ||
notify.js | ||
overrides.js | ||
run-update-check.js | ||
update-check.js |