instructeurs: create without providing the email

This commit is contained in:
Pierre de La Morinerie 2019-10-16 12:15:47 +00:00
parent f131dbb80d
commit f8358b3ae9
7 changed files with 22 additions and 15 deletions

View file

@ -0,0 +1,13 @@
class RemoveUniqueConstraintOnInstructeurEmails < ActiveRecord::Migration[5.2]
def up
# Drop the index entirely
remove_index :instructeurs, :email
# Add the index again, without the unicity constraint
add_index :instructeurs, :email
end
def down
remove_index :instructeurs, :email
add_index :instructeurs, :email, unique: true
end
end