Sha256: fe259a5db993991f78cab53a6f674e8c7b073c61a64efcc6a94fdc78fecc7e83

Contents?: true

Size: 1.2 KB

Versions: 42

Compression:

Stored size: 1.2 KB

Contents

# This migration comes from activeadmin_selleo_cms (originally 20121221164723)
class CreateActiveadminSelleoCmsSearches < ActiveRecord::Migration
  def up
    ActiveRecord::Base.connection.execute <<-SQL
    CREATE VIEW activeadmin_selleo_cms_searches AS
      SELECT
        'ActiveadminSelleoCms::Page' AS searchable_type,
        page_translations.activeadmin_selleo_cms_page_id AS searchable_id,
        coalesce(page_translations.title,'')||' '||coalesce(page_translations.browser_title,'') AS content,
        page_translations.locale
      FROM
        activeadmin_selleo_cms_page_translations page_translations

      UNION ALL

      SELECT
        'ActiveadminSelleoCms::Page' AS searchable_type,
        sections.sectionable_id AS searchable_id,
        coalesce(section_translations.body,'') AS content,
        section_translations.locale
      FROM
        activeadmin_selleo_cms_section_translations section_translations
      INNER JOIN
        activeadmin_selleo_cms_sections sections
          ON sections.id = section_translations.activeadmin_selleo_cms_section_id
    SQL
  end

  def down
    ActiveRecord::Base.connection.execute <<-SQL
      DROP VIEW activeadmin_selleo_cms_searches
    SQL
  end
end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
activeadmin-selleo-cms-0.0.61 spec/dummy/db/migrate/20130117150804_create_activeadmin_selleo_cms_searches.activeadmin_selleo_cms.rb
activeadmin-selleo-cms-0.0.60 spec/dummy/db/migrate/20130117150804_create_activeadmin_selleo_cms_searches.activeadmin_selleo_cms.rb
activeadmin-selleo-cms-0.0.59 spec/dummy/db/migrate/20130117150804_create_activeadmin_selleo_cms_searches.activeadmin_selleo_cms.rb
activeadmin-selleo-cms-0.0.58 spec/dummy/db/migrate/20130117150804_create_activeadmin_selleo_cms_searches.activeadmin_selleo_cms.rb
activeadmin-selleo-cms-0.0.54 spec/dummy/db/migrate/20130117150804_create_activeadmin_selleo_cms_searches.activeadmin_selleo_cms.rb
activeadmin-selleo-cms-0.0.52 spec/dummy/db/migrate/20130117150804_create_activeadmin_selleo_cms_searches.activeadmin_selleo_cms.rb
activeadmin-selleo-cms-0.0.51 spec/dummy/db/migrate/20130117150804_create_activeadmin_selleo_cms_searches.activeadmin_selleo_cms.rb
activeadmin-selleo-cms-0.0.49 spec/dummy/db/migrate/20130117150804_create_activeadmin_selleo_cms_searches.activeadmin_selleo_cms.rb
activeadmin-selleo-cms-0.0.48 spec/dummy/db/migrate/20130117150804_create_activeadmin_selleo_cms_searches.activeadmin_selleo_cms.rb
activeadmin-selleo-cms-0.0.47 spec/dummy/db/migrate/20130117150804_create_activeadmin_selleo_cms_searches.activeadmin_selleo_cms.rb
activeadmin-selleo-cms-0.0.46 spec/dummy/db/migrate/20130117150804_create_activeadmin_selleo_cms_searches.activeadmin_selleo_cms.rb
activeadmin-selleo-cms-0.0.45 spec/dummy/db/migrate/20130117150804_create_activeadmin_selleo_cms_searches.activeadmin_selleo_cms.rb
activeadmin-selleo-cms-0.0.44 spec/dummy/db/migrate/20130117150804_create_activeadmin_selleo_cms_searches.activeadmin_selleo_cms.rb
activeadmin-selleo-cms-0.0.43 spec/dummy/db/migrate/20130117150804_create_activeadmin_selleo_cms_searches.activeadmin_selleo_cms.rb
activeadmin-selleo-cms-0.0.42 spec/dummy/db/migrate/20130117150804_create_activeadmin_selleo_cms_searches.activeadmin_selleo_cms.rb
activeadmin-selleo-cms-0.0.41 spec/dummy/db/migrate/20130117150804_create_activeadmin_selleo_cms_searches.activeadmin_selleo_cms.rb
activeadmin-selleo-cms-0.0.40 spec/dummy/db/migrate/20130117150804_create_activeadmin_selleo_cms_searches.activeadmin_selleo_cms.rb
activeadmin-selleo-cms-0.0.39 spec/dummy/db/migrate/20130117150804_create_activeadmin_selleo_cms_searches.activeadmin_selleo_cms.rb
activeadmin-selleo-cms-0.0.38 spec/dummy/db/migrate/20130117150804_create_activeadmin_selleo_cms_searches.activeadmin_selleo_cms.rb
activeadmin-selleo-cms-0.0.37 spec/dummy/db/migrate/20130117150804_create_activeadmin_selleo_cms_searches.activeadmin_selleo_cms.rb