[vhffs-dev] [2132] sorting vhffs_history using history_id as well when timestamp are equals for several rows

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


Revision: 2132
Author:   gradator
Date:     2012-03-10 00:27:42 +0100 (Sat, 10 Mar 2012)
Log Message:
-----------
sorting vhffs_history using history_id as well when timestamp are equals for several rows

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

Modified: trunk/vhffs-api/src/Vhffs/Group.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Group.pm	2012-03-08 21:39:53 UTC (rev 2131)
+++ trunk/vhffs-api/src/Vhffs/Group.pm	2012-03-09 23:27:42 UTC (rev 2132)
@@ -593,7 +593,7 @@
 sub get_full_history {
 	my $self = shift;
 
-	my $sql = 'SELECT o.object_id,o.type,h.history_id,h.date,h.message,source.username as source FROM vhffs_history h INNER JOIN vhffs_object o ON o.object_id=h.object_id LEFT JOIN vhffs_users source ON source.uid = h.source_uid WHERE o.owner_gid=? ORDER BY date DESC';
+	my $sql = 'SELECT o.object_id,o.type,h.history_id,h.date,h.message,source.username as source FROM vhffs_history h INNER JOIN vhffs_object o ON o.object_id=h.object_id LEFT JOIN vhffs_users source ON source.uid = h.source_uid WHERE o.owner_gid=? ORDER BY h.date DESC, h.history_id DESC';
 	my $dbh = $self->get_db;
 	return $dbh->selectall_arrayref($sql, {Slice => {}}, $self->{gid});
 }

Modified: trunk/vhffs-api/src/Vhffs/Object.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Object.pm	2012-03-08 21:39:53 UTC (rev 2131)
+++ trunk/vhffs-api/src/Vhffs/Object.pm	2012-03-09 23:27:42 UTC (rev 2132)
@@ -560,7 +560,7 @@
 	my $self = shift;
 
 	my $dbh = $self->get_db;
-	my $sql = 'SELECT history_id, message, date, source.username as source FROM vhffs_history h LEFT JOIN vhffs_users source ON source.uid = h.source_uid WHERE h.object_id = ? ORDER BY date DESC';
+	my $sql = 'SELECT history_id, message, date, source.username as source FROM vhffs_history h LEFT JOIN vhffs_users source ON source.uid = h.source_uid WHERE h.object_id = ? ORDER BY h.date DESC, h.history_id DESC';
 	return $dbh->selectall_arrayref($sql, {Slice => {}}, $self->{object_id});
 }
 


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