Add Indexes
Learn how to add indexes.
Our table is looking good so far, but there is still something missing. We didn’t add any indexes, which will slow down our queries substantially. Let’s fix that now.
Edit a migration or create a new one?
This change raises interesting questions. Should we generate a new migration to add these indexes, or should we edit the migration we already made?
Generally, it’s OK to edit an existing migration provided that we haven’t already committed our migration to source control. Once our migration is available to other ...