Sha256: 5d6ea4c306c49a8f1736f32538169fd12a2eccabd7167b04fb693377be571e40

Contents?: true

Size: 1015 Bytes

Versions: 82

Compression:

Stored size: 1015 Bytes

Contents

class AddEventPerformancesView < ActiveRecord::Migration
  def up
    execute <<-SQL
      CREATE OR REPLACE VIEW festivity_event_performances AS
        SELECT
          performance.id AS performance_id, performance.start_date, performance.end_date,
          event.id AS event_id, event.title AS event_title, event.short_description, event.buy_url,
          event.featured_item, event.header, event.sub_header, location.id as location_id,
          location.slug AS location_slug, location.title AS location_title, location.festivity_directions_url,
          area.id AS area_id, area.slug as area_slug, area.title AS area_title
        FROM festivity_performances performance
        INNER JOIN pages event
          ON event.id = performance.event_page_id
        INNER JOIN pages location
          ON location.id = performance.location_page_id
        INNER JOIN pages area
          ON area.id = location.parent_id
    SQL

  end

  def down
    execute 'DROP VIEW festivity_event_performances'
  end
end


Version data entries

82 entries across 82 versions & 1 rubygems

Version Path
trusty-festivity-extension-2.3.21 db/migrate/200150325136087799_add_event_performances_view.rb
trusty-festivity-extension-2.3.20 db/migrate/200150325136087799_add_event_performances_view.rb
trusty-festivity-extension-2.3.19 db/migrate/200150325136087799_add_event_performances_view.rb
trusty-festivity-extension-2.3.18 db/migrate/200150325136087799_add_event_performances_view.rb
trusty-festivity-extension-2.3.17 db/migrate/200150325136087799_add_event_performances_view.rb
trusty-festivity-extension-2.3.16 db/migrate/200150325136087799_add_event_performances_view.rb
trusty-festivity-extension-2.3.15 db/migrate/200150325136087799_add_event_performances_view.rb
trusty-festivity-extension-2.3.14 db/migrate/200150325136087799_add_event_performances_view.rb
trusty-festivity-extension-2.3.13 db/migrate/200150325136087799_add_event_performances_view.rb
trusty-festivity-extension-2.3.12 db/migrate/200150325136087799_add_event_performances_view.rb
trusty-festivity-extension-2.3.11g db/migrate/200150325136087799_add_event_performances_view.rb
trusty-festivity-extension-2.3.10 db/migrate/200150325136087799_add_event_performances_view.rb
trusty-festivity-extension-2.3.9 db/migrate/200150325136087799_add_event_performances_view.rb
trusty-festivity-extension-2.3.8 db/migrate/200150325136087799_add_event_performances_view.rb
trusty-festivity-extension-2.3.7 db/migrate/200150325136087799_add_event_performances_view.rb
trusty-festivity-extension-2.3.6 db/migrate/200150325136087799_add_event_performances_view.rb
trusty-festivity-extension-2.3.5 db/migrate/200150325136087799_add_event_performances_view.rb
trusty-festivity-extension-2.3.4 db/migrate/200150325136087799_add_event_performances_view.rb
trusty-festivity-extension-2.3.3 db/migrate/200150325136087799_add_event_performances_view.rb
trusty-festivity-extension-2.3.2 db/migrate/200150325136087799_add_event_performances_view.rb