Skip to content

Commit

Permalink
Merge branch 'hotfix/1.37.0.1' into hotfix/1.38.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
artoscinote committed Nov 22, 2024
2 parents 4c57d97 + 5ed17ae commit 0d9640f
Show file tree
Hide file tree
Showing 8 changed files with 179 additions and 202 deletions.
4 changes: 1 addition & 3 deletions db/migrate/20151021082639_add_pg_trgm_support.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

class AddPgTrgmSupport < ActiveRecord::Migration[4.2]
def up
if db_adapter_is? "PostgreSQL" then
enable_extension :pg_trgm
end
enable_extension :pg_trgm
end
end
36 changes: 16 additions & 20 deletions db/migrate/20151021085335_add_search_query_indexes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,16 @@ def up

# Add GIST trigram indexes onto columns that check for
# ILIKE %pattern% during search
if db_adapter_is? "PostgreSQL" then
add_gist_index :projects, :name
add_gist_index :my_modules, :name
add_gist_index :my_module_groups, :name
add_gist_index :tags, :name
add_gist_index :steps, :name
add_gist_index :results, :name
add_gist_index :projects, :name
add_gist_index :my_modules, :name
add_gist_index :my_module_groups, :name
add_gist_index :tags, :name
add_gist_index :steps, :name
add_gist_index :results, :name

# There's already semi-useless BTree index on samples
remove_index :samples, :name
add_gist_index :samples, :name
end
remove_index :samples, :name
add_gist_index :samples, :name
end

def down
Expand All @@ -34,17 +32,15 @@ def down
remove_index :user_projects, :project_id
remove_index :tags, :project_id

if db_adapter_is? "PostgreSQL" then
remove_index :projects, :name
remove_index :my_modules, :name
remove_index :my_module_groups, :name
remove_index :tags, :name
remove_index :steps, :name
remove_index :results, :name
remove_index :projects, :name
remove_index :my_modules, :name
remove_index :my_module_groups, :name
remove_index :tags, :name
remove_index :steps, :name
remove_index :results, :name

# Re-add semi-useless BTree index on samples
remove_index :samples, :name
add_index :samples, :name
end
remove_index :samples, :name
add_index :samples, :name
end
end
4 changes: 1 addition & 3 deletions db/migrate/20151103155048_add_btree_gist_extension.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

class AddBtreeGistExtension < ActiveRecord::Migration[4.2]
def up
if db_adapter_is? "PostgreSQL" then
enable_extension :btree_gist
end
enable_extension :btree_gist
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ class AddTextSearchVectorToAssetTextData < ActiveRecord::Migration[4.2]
def change
add_column :asset_text_data, :data_vector, :tsvector

if db_adapter_is? "PostgreSQL" then
add_index :asset_text_data, :data_vector, using: "gin"
end
add_index :asset_text_data, :data_vector, using: "gin"
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ class AddTextSearchVectorToTables < ActiveRecord::Migration[4.2]
def change
add_column :tables, :data_vector, :tsvector

if db_adapter_is? "PostgreSQL" then
add_index :tables, :data_vector, using: "gin"
end
add_index :tables, :data_vector, using: "gin"
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@

class GenerateTextSearchVectorForTableContents < ActiveRecord::Migration[4.2]
def up
if db_adapter_is? "PostgreSQL" then
execute <<-SQL
UPDATE tables
SET data_vector =
to_tsvector(substring(encode(contents::bytea, 'escape'), 9))
SQL
end
execute <<-SQL
UPDATE tables
SET data_vector =
to_tsvector(substring(encode(contents::bytea, 'escape'), 9))
SQL
end
end
Loading

0 comments on commit 0d9640f

Please sign in to comment.