[deploy] Fix badges slug migration (#7392)
This commit is contained in:
parent
4f374acbc5
commit
b7e5aaef18
1 changed files with 9 additions and 1 deletions
|
|
@ -1,7 +1,15 @@
|
|||
class AddUniqueIndexToBadgesSlug < ActiveRecord::Migration[5.2]
|
||||
disable_ddl_transaction!
|
||||
|
||||
def change
|
||||
def up
|
||||
return if index_exists?(:badges, :slug)
|
||||
|
||||
add_index :badges, :slug, unique: true, algorithm: :concurrently
|
||||
end
|
||||
|
||||
def down
|
||||
return unless index_exists?(:badges, :slug)
|
||||
|
||||
remove_index :badges, :slug
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue