It's been a few weeks since files were added to the database, from the S3 bucket. Before starting work in the production configuration of the system, it would be good to get the list updated.
But, in the process of looking at updating the list, a problem has been found. It seems there are duplicate entries in the file list in MongoDB, in spite of the unique index that was supposed to have been applied. How did that happen? What can be done about it? The list needs to be unique, or things will start to go awry later on.
In this episode, you'll see how to fix this problem by using a tool for database migrations. You'll set up a migration script to create the unique index and find out just what happens when it is created with duplicate data in the database already.