Compare commits
4 commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7acb7c190f | |||
| 68d1e33827 | |||
| d7d423260d | |||
| b801c99775 |
7 changed files with 37 additions and 7 deletions
|
|
@ -14,15 +14,19 @@ class Character < ApplicationRecord
|
||||||
}
|
}
|
||||||
|
|
||||||
pg_search_scope :en_search,
|
pg_search_scope :en_search,
|
||||||
against: :name_en,
|
against: %i[name_en nicknames_en],
|
||||||
using: {
|
using: {
|
||||||
|
tsearch: {
|
||||||
|
prefix: true,
|
||||||
|
dictionary: 'simple'
|
||||||
|
},
|
||||||
trigram: {
|
trigram: {
|
||||||
threshold: 0.18
|
threshold: 0.18
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pg_search_scope :ja_search,
|
pg_search_scope :ja_search,
|
||||||
against: :name_jp,
|
against: %i[name_jp nicknames_jp],
|
||||||
using: {
|
using: {
|
||||||
tsearch: {
|
tsearch: {
|
||||||
prefix: true,
|
prefix: true,
|
||||||
|
|
|
||||||
|
|
@ -14,15 +14,19 @@ class Summon < ApplicationRecord
|
||||||
}
|
}
|
||||||
|
|
||||||
pg_search_scope :en_search,
|
pg_search_scope :en_search,
|
||||||
against: :name_en,
|
against: %i[name_en nicknames_en],
|
||||||
using: {
|
using: {
|
||||||
|
tsearch: {
|
||||||
|
prefix: true,
|
||||||
|
dictionary: 'simple'
|
||||||
|
},
|
||||||
trigram: {
|
trigram: {
|
||||||
threshold: 0.18
|
threshold: 0.18
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pg_search_scope :ja_search,
|
pg_search_scope :ja_search,
|
||||||
against: :name_jp,
|
against: %i[name_jp nicknames_jp],
|
||||||
using: {
|
using: {
|
||||||
tsearch: {
|
tsearch: {
|
||||||
prefix: true,
|
prefix: true,
|
||||||
|
|
|
||||||
|
|
@ -14,15 +14,19 @@ class Weapon < ApplicationRecord
|
||||||
}
|
}
|
||||||
|
|
||||||
pg_search_scope :en_search,
|
pg_search_scope :en_search,
|
||||||
against: :name_en,
|
against: %i[name_en nicknames_en],
|
||||||
using: {
|
using: {
|
||||||
|
tsearch: {
|
||||||
|
prefix: true,
|
||||||
|
dictionary: 'simple'
|
||||||
|
},
|
||||||
trigram: {
|
trigram: {
|
||||||
threshold: 0.18
|
threshold: 0.18
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pg_search_scope :ja_search,
|
pg_search_scope :ja_search,
|
||||||
against: :name_jp,
|
against: %i[name_jp nicknames_jp],
|
||||||
using: {
|
using: {
|
||||||
tsearch: {
|
tsearch: {
|
||||||
prefix: true,
|
prefix: true,
|
||||||
|
|
|
||||||
6
db/migrate/20230820113800_add_nicknames_to_characters.rb
Normal file
6
db/migrate/20230820113800_add_nicknames_to_characters.rb
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
class AddNicknamesToCharacters < ActiveRecord::Migration[7.0]
|
||||||
|
def change
|
||||||
|
add_column :characters, :nicknames_en, :string, array: true, default: [], null: false, if_not_exists: true
|
||||||
|
add_column :characters, :nicknames_jp, :string, array: true, default: [], null: false, if_not_exists: true
|
||||||
|
end
|
||||||
|
end
|
||||||
6
db/migrate/20230820113810_add_nicknames_to_summons.rb
Normal file
6
db/migrate/20230820113810_add_nicknames_to_summons.rb
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
class AddNicknamesToSummons < ActiveRecord::Migration[7.0]
|
||||||
|
def change
|
||||||
|
add_column :summons, :nicknames_en, :string, array: true, default: [], null: false, if_not_exists: true
|
||||||
|
add_column :summons, :nicknames_jp, :string, array: true, default: [], null: false, if_not_exists: true
|
||||||
|
end
|
||||||
|
end
|
||||||
6
db/migrate/20230820113900_add_nicknames_to_weapons.rb
Normal file
6
db/migrate/20230820113900_add_nicknames_to_weapons.rb
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
class AddNicknamesToWeapons < ActiveRecord::Migration[7.0]
|
||||||
|
def change
|
||||||
|
add_column :weapons, :nicknames_en, :string, array: true, default: [], null: false, if_not_exists: true
|
||||||
|
add_column :weapons, :nicknames_jp, :string, array: true, default: [], null: false, if_not_exists: true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
@ -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_08_20_045019) do
|
ActiveRecord::Schema[7.0].define(version: 2023_08_20_113900) 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"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue