Add table for multisearch
This commit is contained in:
parent
193b1b7b2d
commit
de9bc358dc
2 changed files with 35 additions and 1 deletions
21
db/migrate/20230705065015_create_pg_search_documents.rb
Normal file
21
db/migrate/20230705065015_create_pg_search_documents.rb
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
class CreatePgSearchDocuments < ActiveRecord::Migration[7.0]
|
||||||
|
def up
|
||||||
|
say_with_time('Creating table for pg_search multisearch') do
|
||||||
|
create_table :pg_search_documents do |t|
|
||||||
|
t.text :content
|
||||||
|
t.string :granblue_id
|
||||||
|
t.string :name_en
|
||||||
|
t.string :name_jp
|
||||||
|
t.integer :element
|
||||||
|
t.belongs_to :searchable, type: :uuid, polymorphic: true, index: true
|
||||||
|
t.timestamps null: false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
say_with_time('Dropping table for pg_search multisearch') do
|
||||||
|
drop_table :pg_search_documents
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
15
db/schema.rb
15
db/schema.rb
|
|
@ -10,7 +10,7 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# It's strongly recommended that you check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema[7.0].define(version: 2023_07_02_035508) do
|
ActiveRecord::Schema[7.0].define(version: 2023_07_05_065015) do
|
||||||
# These are extensions that must be enabled in order to support this database
|
# These are extensions that must be enabled in order to support this database
|
||||||
enable_extension "btree_gin"
|
enable_extension "btree_gin"
|
||||||
enable_extension "pg_trgm"
|
enable_extension "pg_trgm"
|
||||||
|
|
@ -361,6 +361,19 @@ ActiveRecord::Schema[7.0].define(version: 2023_07_02_035508) do
|
||||||
t.index ["user_id"], name: "index_parties_on_user_id"
|
t.index ["user_id"], name: "index_parties_on_user_id"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
create_table "pg_search_documents", force: :cascade do |t|
|
||||||
|
t.text "content"
|
||||||
|
t.string "granblue_id"
|
||||||
|
t.string "name_en"
|
||||||
|
t.string "name_jp"
|
||||||
|
t.integer "element"
|
||||||
|
t.string "searchable_type"
|
||||||
|
t.uuid "searchable_id"
|
||||||
|
t.datetime "created_at", null: false
|
||||||
|
t.datetime "updated_at", null: false
|
||||||
|
t.index ["searchable_type", "searchable_id"], name: "index_pg_search_documents_on_searchable"
|
||||||
|
end
|
||||||
|
|
||||||
create_table "raid_groups", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
|
create_table "raid_groups", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
|
||||||
t.string "name_en", null: false
|
t.string "name_en", null: false
|
||||||
t.string "name_jp", null: false
|
t.string "name_jp", null: false
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue