Migrate the database and add email indexes to ensure email uniqueness