OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Enable the pg_trgm module for all the schemas
Dombi Attila42ca7bb199f3
diff --git a/db/migrate/20230328154645_add_gin_trgm_index_on_journals_and_custom_values.rb b/db/migrate/20230328154645_add_gin_trgm_index_on_journals_and_custom_values.rbindex 2d5f706d484..4ffabf13fb7 100644--- a/db/migrate/20230328154645_add_gin_trgm_index_on_journals_and_custom_values.rb+++ b/db/migrate/20230328154645_add_gin_trgm_index_on_journals_and_custom_values.rb@@ -1,5 +1,5 @@class AddGinTrgmIndexOnJournalsAndCustomValues < ActiveRecord::Migration[7.0]- def change+ def upsafe_enable_pg_trgm_extensionif extensions.include?('pg_trgm')@@ -8,10 +8,16 @@ class AddGinTrgmIndexOnJournalsAndCustomValues < ActiveRecord::Migration[7.0]endend+ def down+ remove_index(:journals, :notes, if_exists: true)+ remove_index(:custom_values, :value, if_exists: true)+ drop_pg_trgm_extension+ end+privatedef safe_enable_pg_trgm_extension- enable_extension("pg_trgm")+ ActiveRecord::Base.connection.execute("CREATE EXTENSION IF NOT EXISTS pg_trgm WITH SCHEMA pg_catalog;")rescue StandardError => eraise unless e.message =~ /pg_trgm/@@ -30,4 +36,8 @@ class AddGinTrgmIndexOnJournalsAndCustomValues < ActiveRecord::Migration[7.0]MESSAGEend++ def drop_pg_trgm_extension+ ActiveRecord::Base.connection.execute("DROP EXTENSION IF EXISTS pg_trgm CASCADE;")+ endend