about summary refs log tree commit diff
path: root/db
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2018-08-22 21:35:07 +0200
committerGitHub <noreply@github.com>2018-08-22 21:35:07 +0200
commit8aa58e34bb2b62192a997ac7ea8919b22fc45f80 (patch)
treeabc0ea9862c55c2e114c855b20eb4a35f1141709 /db
parent628fca50e20bcf41f206877083fc5ee8789c1088 (diff)
parente70fc059a9511d43b42c2502514f6220b416cdd5 (diff)
Merge pull request #665 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20180820232245_add_foreign_key_indices.rb16
-rw-r--r--db/schema.rb10
2 files changed, 25 insertions, 1 deletions
diff --git a/db/migrate/20180820232245_add_foreign_key_indices.rb b/db/migrate/20180820232245_add_foreign_key_indices.rb
new file mode 100644
index 000000000..e346c1f5b
--- /dev/null
+++ b/db/migrate/20180820232245_add_foreign_key_indices.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class AddForeignKeyIndices < ActiveRecord::Migration[5.2]
+  disable_ddl_transaction!
+
+  def change
+    add_index :follows, :target_account_id, algorithm: :concurrently
+    add_index :blocks, :target_account_id, algorithm: :concurrently
+    add_index :mutes, :target_account_id, algorithm: :concurrently
+    add_index :notifications, :from_account_id, algorithm: :concurrently
+    add_index :accounts, :moved_to_account_id, algorithm: :concurrently
+    add_index :statuses, :in_reply_to_account_id, algorithm: :concurrently
+    add_index :session_activations, :access_token_id, algorithm: :concurrently
+    add_index :oauth_access_grants, :resource_owner_id, algorithm: :concurrently
+  end
+end
diff --git a/db/schema.rb b/db/schema.rb
index bac85869a..8c0f5431d 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -10,7 +10,7 @@
 #
 # It's strongly recommended that you check this file into your version control system.
 
-ActiveRecord::Schema.define(version: 2018_08_14_171349) do
+ActiveRecord::Schema.define(version: 2018_08_20_232245) do
 
   # These are extensions that must be enabled in order to support this database
   enable_extension "plpgsql"
@@ -88,6 +88,7 @@ ActiveRecord::Schema.define(version: 2018_08_14_171349) do
     t.string "actor_type"
     t.index "(((setweight(to_tsvector('simple'::regconfig, (display_name)::text), 'A'::\"char\") || setweight(to_tsvector('simple'::regconfig, (username)::text), 'B'::\"char\")) || setweight(to_tsvector('simple'::regconfig, (COALESCE(domain, ''::character varying))::text), 'C'::\"char\")))", name: "search_index", using: :gin
     t.index "lower((username)::text), lower((domain)::text)", name: "index_accounts_on_username_and_domain_lower", unique: true
+    t.index ["moved_to_account_id"], name: "index_accounts_on_moved_to_account_id"
     t.index ["uri"], name: "index_accounts_on_uri"
     t.index ["url"], name: "index_accounts_on_url"
   end
@@ -122,6 +123,7 @@ ActiveRecord::Schema.define(version: 2018_08_14_171349) do
     t.bigint "target_account_id", null: false
     t.string "uri"
     t.index ["account_id", "target_account_id"], name: "index_blocks_on_account_id_and_target_account_id", unique: true
+    t.index ["target_account_id"], name: "index_blocks_on_target_account_id"
   end
 
   create_table "bookmarks", force: :cascade do |t|
@@ -219,6 +221,7 @@ ActiveRecord::Schema.define(version: 2018_08_14_171349) do
     t.boolean "show_reblogs", default: true, null: false
     t.string "uri"
     t.index ["account_id", "target_account_id"], name: "index_follows_on_account_id_and_target_account_id", unique: true
+    t.index ["target_account_id"], name: "index_follows_on_target_account_id"
   end
 
   create_table "identities", id: :serial, force: :cascade do |t|
@@ -307,6 +310,7 @@ ActiveRecord::Schema.define(version: 2018_08_14_171349) do
     t.bigint "account_id", null: false
     t.bigint "target_account_id", null: false
     t.index ["account_id", "target_account_id"], name: "index_mutes_on_account_id_and_target_account_id", unique: true
+    t.index ["target_account_id"], name: "index_mutes_on_target_account_id"
   end
 
   create_table "notifications", force: :cascade do |t|
@@ -319,6 +323,7 @@ ActiveRecord::Schema.define(version: 2018_08_14_171349) do
     t.index ["account_id", "activity_id", "activity_type"], name: "account_activity", unique: true
     t.index ["account_id", "id"], name: "index_notifications_on_account_id_and_id", order: { id: :desc }
     t.index ["activity_id", "activity_type"], name: "index_notifications_on_activity_id_and_activity_type"
+    t.index ["from_account_id"], name: "index_notifications_on_from_account_id"
   end
 
   create_table "oauth_access_grants", force: :cascade do |t|
@@ -330,6 +335,7 @@ ActiveRecord::Schema.define(version: 2018_08_14_171349) do
     t.string "scopes"
     t.bigint "application_id", null: false
     t.bigint "resource_owner_id", null: false
+    t.index ["resource_owner_id"], name: "index_oauth_access_grants_on_resource_owner_id"
     t.index ["token"], name: "index_oauth_access_grants_on_token", unique: true
   end
 
@@ -433,6 +439,7 @@ ActiveRecord::Schema.define(version: 2018_08_14_171349) do
     t.bigint "access_token_id"
     t.bigint "user_id", null: false
     t.bigint "web_push_subscription_id"
+    t.index ["access_token_id"], name: "index_session_activations_on_access_token_id"
     t.index ["session_id"], name: "index_session_activations_on_session_id", unique: true
     t.index ["user_id"], name: "index_session_activations_on_user_id"
   end
@@ -497,6 +504,7 @@ ActiveRecord::Schema.define(version: 2018_08_14_171349) do
     t.bigint "in_reply_to_account_id"
     t.boolean "local_only"
     t.index ["account_id", "id", "visibility", "updated_at"], name: "index_statuses_20180106", order: { id: :desc }
+    t.index ["in_reply_to_account_id"], name: "index_statuses_on_in_reply_to_account_id"
     t.index ["in_reply_to_id"], name: "index_statuses_on_in_reply_to_id"
     t.index ["reblog_of_id", "account_id"], name: "index_statuses_on_reblog_of_id_and_account_id"
     t.index ["uri"], name: "index_statuses_on_uri", unique: true