Retrospring/db/migrate/20231107200845_optimise_ind...

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

13 lines
429 B
Ruby
Raw Normal View History

2023-11-07 12:24:49 -08:00
# frozen_string_literal: true
class OptimiseIndices < ActiveRecord::Migration[7.0]
def change
add_index :users, "LOWER(screen_name)", order: :desc, unique: true
remove_index :users, :screen_name, unique: true
add_index :user_bans, :expires_at, order: :desc
add_index :announcements, %i[starts_at ends_at], order: :desc
2023-11-07 12:44:49 -08:00
remove_index :themes, %i[user_id created_at]
add_index :themes, :user_id
2023-11-07 12:24:49 -08:00
end
end