Add searchability support

This commit is contained in:
KMY 2023-04-06 04:27:52 +09:00
parent a2e674af51
commit af20b1d2aa
43 changed files with 716 additions and 65 deletions

View file

@ -0,0 +1,5 @@
class AddSearchabilityToStatuses < ActiveRecord::Migration[6.1]
def change
add_column :statuses, :searchability, :integer
end
end

View file

@ -0,0 +1,5 @@
class AddSearchabilityToAccounts < ActiveRecord::Migration[6.1]
def change
add_column :accounts, :searchability, :integer, null: false, default: 0
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: 2023_03_20_234918) do
ActiveRecord::Schema.define(version: 2023_04_05_121625) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -188,6 +188,7 @@ ActiveRecord::Schema.define(version: 2023_03_20_234918) do
t.datetime "reviewed_at"
t.datetime "requested_review_at"
t.boolean "group_allow_private_message"
t.integer "searchability", default: 0, null: false
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), COALESCE(lower((domain)::text), ''::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", where: "(moved_to_account_id IS NOT NULL)"
@ -969,6 +970,7 @@ ActiveRecord::Schema.define(version: 2023_03_20_234918) do
t.datetime "edited_at"
t.boolean "trendable"
t.bigint "ordered_media_attachment_ids", array: true
t.integer "searchability"
t.index ["account_id", "id", "visibility", "updated_at"], name: "index_statuses_20190820", order: { id: :desc }, where: "(deleted_at IS NULL)"
t.index ["account_id"], name: "index_statuses_on_account_id"
t.index ["deleted_at"], name: "index_statuses_on_deleted_at", where: "(deleted_at IS NOT NULL)"
@ -1089,6 +1091,7 @@ ActiveRecord::Schema.define(version: 2023_03_20_234918) do
t.inet "sign_up_ip"
t.boolean "skip_sign_in_token"
t.bigint "role_id"
t.text "settings"
t.index ["account_id"], name: "index_users_on_account_id"
t.index ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true
t.index ["created_by_application_id"], name: "index_users_on_created_by_application_id", where: "(created_by_application_id IS NOT NULL)"