diff --git a/db/migrate/20230705065015_create_pg_search_documents.rb b/db/migrate/20230705065015_create_pg_search_documents.rb new file mode 100644 index 0000000..ce81c4f --- /dev/null +++ b/db/migrate/20230705065015_create_pg_search_documents.rb @@ -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 diff --git a/db/schema.rb b/db/schema.rb index 0dd39f7..6abca66 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[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 enable_extension "btree_gin" 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" 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| t.string "name_en", null: false t.string "name_jp", null: false