mirror of
https://github.com/discourse/discourse.git
synced 2026-08-08 17:53:55 +08:00
14 lines
423 B
Ruby
Vendored
14 lines
423 B
Ruby
Vendored
# frozen_string_literal: true
|
|
|
|
class RebuildDirectoryItemWithIndex < ActiveRecord::Migration[4.2]
|
|
def up
|
|
remove_index :directory_items, [:period_type]
|
|
execute "TRUNCATE TABLE directory_items RESTART IDENTITY"
|
|
add_index :directory_items, %i[period_type user_id], unique: true
|
|
end
|
|
|
|
def down
|
|
remove_index :directory_items, %i[period_type user_id]
|
|
add_index :directory_items, [:period_type]
|
|
end
|
|
end
|