Mercurial > hg > soundsoftware-site
comparison .svn/pristine/d6/d6d2d7c49f7779d8e6b7df27e7cb7703684fb6de.svn-base @ 926:b73a59a6acbd luisf
Merge from cannam_integration
author | luisf <luis.figueira@eecs.qmul.ac.uk> |
---|---|
date | Fri, 11 May 2012 16:10:11 +0100 |
parents | cbb26bc654de |
children |
comparison
equal
deleted
inserted
replaced
925:5bf2b9fac683 | 926:b73a59a6acbd |
---|---|
1 class CreateProjectsTrackers < ActiveRecord::Migration | |
2 def self.up | |
3 create_table :projects_trackers, :id => false do |t| | |
4 t.column :project_id, :integer, :default => 0, :null => false | |
5 t.column :tracker_id, :integer, :default => 0, :null => false | |
6 end | |
7 add_index :projects_trackers, :project_id, :name => :projects_trackers_project_id | |
8 | |
9 # Associates all trackers to all projects (as it was before) | |
10 tracker_ids = Tracker.find(:all).collect(&:id) | |
11 Project.find(:all).each do |project| | |
12 project.tracker_ids = tracker_ids | |
13 end | |
14 end | |
15 | |
16 def self.down | |
17 drop_table :projects_trackers | |
18 end | |
19 end |