artsy / positron

Positron is Artsy Writer or the editorial tool and API for Artsy.
MIT License
85 stars 42 forks source link

Add recommended indices to articles collection (PLATFORM-3169) #migration #2925

Closed joeyAghion closed 3 years ago

joeyAghion commented 3 years ago

As part of PLATFORM-3169 and https://github.com/artsy/gravity/pull/13855, we noticed that Atlas recommended 2 additional indices on the articles collection.

This PR follows the convention (introduced in https://github.com/artsy/positron/pull/1824 and discussed here) of committing the migration to the scripts/db directory. I've already applied it to staging (via VPN) like:

mongo "mongodb+srv://staging.0txbf.mongodb.net/app29923450" --username positron2 --password [REDACTED] scripts/db/20210225101205_add_articles_indices.js

Migrations are not automatically applied upon deploy, so a similar step will be necessary for production.

https://artsyproduct.atlassian.net/browse/PLATFORM-3169

joeyAghion commented 3 years ago

Applied in production!