Mercurial > hg > soundsoftware-site
comparison db/migrate/081_create_projects_trackers.rb @ 912:5e80956cc792 cannam_integration
Merge from branch "redmine-1.3"
author | Chris Cannam |
---|---|
date | Mon, 27 Feb 2012 13:53:18 +0000 |
parents | cbb26bc654de |
children | 622f24f53b42 |
comparison
equal
deleted
inserted
replaced
911:487d96eac004 | 912:5e80956cc792 |
---|---|
3 create_table :projects_trackers, :id => false do |t| | 3 create_table :projects_trackers, :id => false do |t| |
4 t.column :project_id, :integer, :default => 0, :null => false | 4 t.column :project_id, :integer, :default => 0, :null => false |
5 t.column :tracker_id, :integer, :default => 0, :null => false | 5 t.column :tracker_id, :integer, :default => 0, :null => false |
6 end | 6 end |
7 add_index :projects_trackers, :project_id, :name => :projects_trackers_project_id | 7 add_index :projects_trackers, :project_id, :name => :projects_trackers_project_id |
8 | 8 |
9 # Associates all trackers to all projects (as it was before) | 9 # Associates all trackers to all projects (as it was before) |
10 tracker_ids = Tracker.find(:all).collect(&:id) | 10 tracker_ids = Tracker.find(:all).collect(&:id) |
11 Project.find(:all).each do |project| | 11 Project.find(:all).each do |project| |
12 project.tracker_ids = tracker_ids | 12 project.tracker_ids = tracker_ids |
13 end | 13 end |