diff db/migrate/007_create_journals.rb @ 935:fe0249c097f6 live

Merge from the default branch
author Chris Cannam
date Wed, 11 Jul 2012 13:33:14 +0100
parents cbb26bc654de
children 622f24f53b42
line wrap: on
line diff
--- a/db/migrate/007_create_journals.rb	Tue Mar 13 16:33:49 2012 +0000
+++ b/db/migrate/007_create_journals.rb	Wed Jul 11 13:33:14 2012 +0100
@@ -4,7 +4,7 @@
   class IssueHistory < ActiveRecord::Base; belongs_to :issue; end
   # model removed
   class Permission < ActiveRecord::Base; end
-  
+
   def self.up
     create_table :journals, :force => true do |t|
       t.column "journalized_id", :integer, :default => 0, :null => false
@@ -20,19 +20,19 @@
       t.column "old_value", :string
       t.column "value", :string
     end
-    
+
     # indexes
     add_index "journals", ["journalized_id", "journalized_type"], :name => "journals_journalized_id"
     add_index "journal_details", ["journal_id"], :name => "journal_details_journal_id"
-    
+
     Permission.create :controller => "issues", :action => "history", :description => "label_history", :sort => 1006, :is_public => true, :mail_option => 0, :mail_enabled => 0
 
     # data migration
     IssueHistory.find(:all, :include => :issue).each {|h|
       j = Journal.new(:journalized => h.issue, :user_id => h.author_id, :notes => h.notes, :created_on => h.created_on)
       j.details << JournalDetail.new(:property => 'attr', :prop_key => 'status_id', :value => h.status_id)
-      j.save    
-    }    
+      j.save
+    }
 
     drop_table :issue_histories
   end
@@ -40,7 +40,7 @@
   def self.down
     drop_table :journal_details
     drop_table :journals
-    
+
     create_table "issue_histories", :force => true do |t|
       t.column "issue_id", :integer, :default => 0, :null => false
       t.column "status_id", :integer, :default => 0, :null => false
@@ -48,7 +48,7 @@
       t.column "notes", :text, :default => ""
       t.column "created_on", :timestamp
     end
-  
+
     add_index "issue_histories", ["issue_id"], :name => "issue_histories_issue_id"
 
     Permission.find(:first, :conditions => ["controller=? and action=?", 'issues', 'history']).destroy