```ruby
class CreateContacts < ActiveRecord::Migration
  def change
    create_table :contacts do |t|
      t.string :email, unique: true

      t.timestamps
    end
  end
end
```

Add unique index to contacts email
user
```ruby
class CreateContacts < ActiveRecord::Migration
  def change
    create_table :contacts do |t|
      t.string :email, unique: true
      t.timestamps
    end
    add_index :contacts, :email, :unique => true
  end
end
```
assistant