mirror of
https://github.com/discourse/discourse.git
synced 2024-12-12 02:43:44 +08:00
14 lines
380 B
Ruby
14 lines
380 B
Ruby
# frozen_string_literal: true
|
|
|
|
class ChangeUserEmailsPrimaryIndex < ActiveRecord::Migration[5.1]
|
|
def up
|
|
remove_index :user_emails, %i[user_id primary]
|
|
add_index :user_emails, %i[user_id primary], unique: true, where: '"primary"'
|
|
end
|
|
|
|
def down
|
|
remove_index :user_emails, %i[user_id primary]
|
|
add_index :user_emails, %i[user_id primary], unique: true
|
|
end
|
|
end
|