README.md in set_as_primary-0.1.2 vs README.md in set_as_primary-0.1.3
- old
+ new
@@ -119,10 +119,10 @@
```ruby
class AddPrimaryColumnToEmailAddresses < ActiveRecord::Migration[6.0]
def change
add_column :email_addresses, :primary, :boolean, default: false, null: false
# NOTE: Please uncomment following line if you want only one 'true' (constraint) in the table.
- # add_index :email_addresses, %i[user_id, primary], unique: true, where: "(email_addresses.primary IS TRUE)"
+ # add_index :email_addresses, %i[user_id primary], unique: true, where: "(email_addresses.primary IS TRUE)"
end
end
```
You might have seen extra commented lines there. These lines are there for handling the unique constraint. Currently, these lines get created only for `PostgreSQL` adapter as it supports partial index.
\ No newline at end of file