Merge branch 'master' into glitch-soc/merge

This commit is contained in:
Thibaut Girka
2018-05-14 20:51:50 +02:00
36 changed files with 314 additions and 260 deletions

View File

@@ -0,0 +1,11 @@
# frozen_string_literal: true
class ImproveIndexOnStatusesForApiV1AccountsAccountIdStatuses < ActiveRecord::Migration[5.1]
disable_ddl_transaction!
def change
add_index :statuses, [:account_id, :id, :visibility], where: 'visibility IN (0, 1, 2)', algorithm: :concurrently
add_index :statuses, [:account_id, :id], where: 'visibility = 3', algorithm: :concurrently
remove_index :statuses, column: [:account_id, :id, :visibility, :updated_at], order: { id: :desc }, algorithm: :concurrently, name: :index_statuses_20180106
end
end

View File

@@ -0,0 +1,14 @@
# frozen_string_literal: true
class RevertIndexChangeOnStatusesForApiV1AccountsAccountIdStatuses < ActiveRecord::Migration[5.1]
disable_ddl_transaction!
def change
safety_assured do
add_index :statuses, [:account_id, :id, :visibility, :updated_at], order: { id: :desc }, algorithm: :concurrently, name: :index_statuses_20180106
end
remove_index :statuses, column: [:account_id, :id, :visibility], where: 'visibility IN (0, 1, 2)', algorithm: :concurrently
remove_index :statuses, column: [:account_id, :id], where: 'visibility = 3', algorithm: :concurrently
end
end

View File

@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2018_05_10_230049) do
ActiveRecord::Schema.define(version: 2018_05_14_140000) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"