Mercurial > hg > soundsoftware-site
comparison db/migrate/007_create_journals.rb @ 1298:4f746d8966dd redmine_2.3_integration
Merge from redmine-2.3 branch to create new branch redmine-2.3-integration
author | Chris Cannam |
---|---|
date | Fri, 14 Jun 2013 09:28:30 +0100 |
parents | 622f24f53b42 |
children |
comparison
equal
deleted
inserted
replaced
1297:0a574315af3e | 1298:4f746d8966dd |
---|---|
26 add_index "journal_details", ["journal_id"], :name => "journal_details_journal_id" | 26 add_index "journal_details", ["journal_id"], :name => "journal_details_journal_id" |
27 | 27 |
28 Permission.create :controller => "issues", :action => "history", :description => "label_history", :sort => 1006, :is_public => true, :mail_option => 0, :mail_enabled => 0 | 28 Permission.create :controller => "issues", :action => "history", :description => "label_history", :sort => 1006, :is_public => true, :mail_option => 0, :mail_enabled => 0 |
29 | 29 |
30 # data migration | 30 # data migration |
31 IssueHistory.find(:all, :include => :issue).each {|h| | 31 IssueHistory.all.each {|h| |
32 j = Journal.new(:journalized => h.issue, :user_id => h.author_id, :notes => h.notes, :created_on => h.created_on) | 32 j = Journal.new(:journalized => h.issue, :user_id => h.author_id, :notes => h.notes, :created_on => h.created_on) |
33 j.details << JournalDetail.new(:property => 'attr', :prop_key => 'status_id', :value => h.status_id) | 33 j.details << JournalDetail.new(:property => 'attr', :prop_key => 'status_id', :value => h.status_id) |
34 j.save | 34 j.save |
35 } | 35 } |
36 | 36 |
49 t.column "created_on", :timestamp | 49 t.column "created_on", :timestamp |
50 end | 50 end |
51 | 51 |
52 add_index "issue_histories", ["issue_id"], :name => "issue_histories_issue_id" | 52 add_index "issue_histories", ["issue_id"], :name => "issue_histories_issue_id" |
53 | 53 |
54 Permission.find(:first, :conditions => ["controller=? and action=?", 'issues', 'history']).destroy | 54 Permission.where("controller=? and action=?", 'issues', 'history').first.destroy |
55 end | 55 end |
56 end | 56 end |