Error after add index to email (Rails tutorial chap 6)


#1

Hi! I got some errors after add index to email of users table. Can any one help me solve this?
Here is the picture.


#2

As it says run bin/rails db:migrate RAILS_ENV=test in the terminal.

The migration was only ran against the dev database and not the test one so you need to run the migration against the test db too.


#3

It still has errror!!!


#5

After I drop all the database, destroy all migration files and build it again, It works fine.
I think the reason would be caused by the duplication in the database (I’m guessing that!!!)