[vhffs-dev] [1206] updater_id and updated fields were inverted

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Revision: 1206
Author:   gradator
Date:     2008-05-24 20:20:00 +0200 (Sat, 24 May 2008)

Log Message:
-----------
updater_id and updated fields were inverted

You have to run something like the following to swap the fields:

BEGIN;
ALTER TABLE vhffs_object_tag ADD COLUMN tmptb integer;
UPDATE vhffs_object_tag SET tmptb=updater_id;
UPDATE vhffs_object_tag SET updater_id=updated WHERE tmptb>1000000;
UPDATE vhffs_object_tag SET updated=tmptb WHERE tmptb>1000000;
ALTER TABLE vhffs_object_tag DROP COLUMN tmptb;
COMMIT;
VACUUM FULL vhffs_object_tag;

Modified Paths:
--------------
    trunk/vhffs-api/src/Vhffs/Tag.pm


Modified: trunk/vhffs-api/src/Vhffs/Tag.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Tag.pm	2008-05-24 12:02:17 UTC (rev 1205)
+++ trunk/vhffs-api/src/Vhffs/Tag.pm	2008-05-24 18:20:00 UTC (rev 1206)
@@ -224,7 +224,7 @@
 	local $dbh->{PrintError} = 0;
 	
 	return $dbh->do(q{INSERT INTO vhffs_object_tag(object_id, tag_id, updated, updater_id) VALUES(?, ?, ?, ?)},
-		undef, $o->get_oid(), $tag->{tag_id}, $updater->get_uid(), $updated);
+		undef, $o->get_oid(), $tag->{tag_id}, $updated, $updater->get_uid());
 }
 
 sub delete_tag {


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/