ChiliProject is not maintained anymore. Please be advised that there will be no more updates.

We do not recommend that you setup new ChiliProject instances and we urge all existing users to migrate their data to a maintained system, e.g. Redmine. We will provide a migration script later. In the meantime, you can use the instructions by Christian Daehn.

Lost WIKI history timestamps during 2.0.0rc1 upgrade. (Bug #468)


Added by Artem Naluzhnyy at 2011-06-11 07:10 pm. Updated at 2011-06-18 04:51 pm.


Status:Closed Start date:2011-06-11
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:Journals / History
Target version:2.0.0
Remote issue URL: Affected version:

Description

During the DB migration to 2.0.0rc1 all timestamps related to WIKI revisions were lost (replaced with the upgrade process timestamp).

This is probably because `wiki_contents`.`updated_on` was not copied to `journals`.`created_at`:

--- 20100804112053_merge_wiki_versions_with_journals.rb.orig    2011-06-10 23:36:19.000000000 +0300
+++ 20100804112053_merge_wiki_versions_with_journals.rb 2011-06-11 21:59:24.000000000 +0300
@@ -20,7 +20,7 @@

     WikiContent::Version.find_by_sql("SELECT * FROM wiki_content_versions").each do |wv|
       journal = WikiContentJournal.create!(:journaled_id => wv.wiki_content_id, :user_id => wv.author_id,
-        :notes => wv.comments, :activity_type => "wiki_edits")
+        :notes => wv.comments, :created_at => wv.updated_on, :activity_type => "wiki_edits")
       changes = {}
       changes["compression"] = wv.compression
       changes["data"] = wv.data

Associated revisions

Revision 2ceffca3
Added by Felix Schäfer at 2011-06-16 09:01 pm

Don't loose the time of the wiki_edits. #468

Contributed by Artem Naluzhnyy.

History

Updated by Felix Schäfer at 2011-06-16 07:02 pm

  • Status changed from Open to Closed

Updated by Artem Naluzhnyy at 2011-06-18 04:51 pm

SQL to fix rc1/rc2 MySQL database (make sure you have a DB backup!):

1UPDATE `journals` j
2  INNER JOIN `wiki_content_versions` w
3    ON j.journaled_id = w.wiki_content_id AND j.version = w.version
4SET j.created_at = w.updated_on
5WHERE j.activity_type = 'wiki_edits'

Also available in: Atom PDF