Sha256: 8f9a4bebfb294416038554cc552c491e852062ded7e8e8f7c96234edcb40177c
Contents?: true
Size: 597 Bytes
Versions: 17
Compression:
Stored size: 597 Bytes
Contents
class AddProjectIdToCommits < ActiveRecord::Migration def up add_column :commits, :project_id, :integer Commit.reset_column_information Commit.find_each do |commit| release = commit.release if release.nil? commit.delete Rails.logger.warn "Deleting commit ##{commit.id} (#{commit.attributes.inspect})" next end commit.update_column(:project_id, release.project_id) end change_column_null :commits, :project_id, false add_index :commits, [:project_id] end def down remove_column :commits, :project_id end end
Version data entries
17 entries across 17 versions & 1 rubygems