Sha256: dfcd51e28c76c905479a38b566fb6c0c01880ea784fea5f051416ba6f1908ceb

Contents?: true

Size: 430 Bytes

Versions: 17

Compression:

Stored size: 430 Bytes

Contents

class LinkTicketsAndReleases < ActiveRecord::Migration
  def up
    create_table :releases_tickets, :id => false do |t|
      t.references :release, :ticket
    end

    add_index :releases_tickets, [:release_id, :ticket_id], :unique => true

    Release.all.each do |release|
      release.tickets.each do |ticket|
        ticket.releases << release
      end
    end
  end

  def down
    drop_table :releases_tickets
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
houston-core-0.8.0.pre db/migrate/20120504143615_link_tickets_and_releases.rb
houston-core-0.7.0 db/migrate/20120504143615_link_tickets_and_releases.rb
houston-core-0.7.0.beta4 db/migrate/20120504143615_link_tickets_and_releases.rb
houston-core-0.7.0.beta3 db/migrate/20120504143615_link_tickets_and_releases.rb
houston-core-0.7.0.beta2 db/migrate/20120504143615_link_tickets_and_releases.rb
houston-core-0.7.0.beta db/migrate/20120504143615_link_tickets_and_releases.rb
houston-core-0.6.3 db/migrate/20120504143615_link_tickets_and_releases.rb
houston-core-0.6.2 db/migrate/20120504143615_link_tickets_and_releases.rb
houston-core-0.6.1 db/migrate/20120504143615_link_tickets_and_releases.rb
houston-core-0.6.0 db/migrate/20120504143615_link_tickets_and_releases.rb
houston-core-0.5.6 db/migrate/20120504143615_link_tickets_and_releases.rb
houston-core-0.5.5 db/migrate/20120504143615_link_tickets_and_releases.rb
houston-core-0.5.4 db/migrate/20120504143615_link_tickets_and_releases.rb
houston-core-0.5.3 db/migrate/20120504143615_link_tickets_and_releases.rb
houston-core-0.5.2 db/migrate/20120504143615_link_tickets_and_releases.rb
houston-core-0.5.1 db/migrate/20120504143615_link_tickets_and_releases.rb
houston-core-0.5.0 db/migrate/20120504143615_link_tickets_and_releases.rb