Sha256: 234d8043e322fb19ca627ccb7f6c883512be9f064e34007551ddf89ca2c7c315

Contents?: true

Size: 1.06 KB

Versions: 6

Compression:

Stored size: 1.06 KB

Contents

# frozen_string_literal: true

class UseEnhancedTextworkMd5Indexes < ActiveRecord::Migration[5.2]
  def up
    remove_index :decidim_enhanced_textwork_paragraphs, name: "decidim_enhanced_textwork_paragraph_title_search"
    remove_index :decidim_enhanced_textwork_paragraphs, name: "decidim_enhanced_textwork_paragraph_body_search"
    execute "CREATE INDEX decidim_enhanced_textwork_paragraph_title_search ON decidim_enhanced_textwork_paragraphs(md5(title::text))"
    execute "CREATE INDEX decidim_enhanced_textwork_paragraph_body_search ON decidim_enhanced_textwork_paragraphs(md5(body::text))"
  end

  def down
    remove_index :decidim_enhanced_textwork_paragraphs, name: "decidim_enhanced_textwork_paragraph_title_search"
    remove_index :decidim_enhanced_textwork_paragraphs, name: "decidim_enhanced_textwork_paragraph_body_search"
    add_index :decidim_enhanced_textwork_paragraphs, :title, name: "decidim_enhanced_textwork_paragraph_title_search"
    add_index :decidim_enhanced_textwork_paragraphs, :body, name: "decidim_enhanced_textwork_paragraph_body_search"
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
decidim-enhanced_textwork-1.0.5 db/migrate/20190215113158_use_enhanced_textwork_md5_indexes.rb
decidim-enhanced_textwork-1.0.4 db/migrate/20190215113158_use_enhanced_textwork_md5_indexes.rb
decidim-enhanced_textwork-1.0.3 db/migrate/20190215113158_use_enhanced_textwork_md5_indexes.rb
decidim-enhanced_textwork-1.0.2 db/migrate/20190215113158_use_enhanced_textwork_md5_indexes.rb
decidim-enhanced_textwork-1.0.1 db/migrate/20190215113158_use_enhanced_textwork_md5_indexes.rb
decidim-enhanced_textwork-1.0.0 db/migrate/20190215113158_use_enhanced_textwork_md5_indexes.rb