From 6a852171267af031c65975312660fc2240da75da Mon Sep 17 00:00:00 2001 From: olivier Date: Thu, 9 Jul 2009 10:20:48 +0000 Subject: [PATCH] fix wrong reported ids in collections:copy task git-svn-id: http://svn.parisson.org/svn/crem@119 3bf09e05-f825-4182-b9bc-eedd7160adf0 --- trunk/import/migration/tasks/collections.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/trunk/import/migration/tasks/collections.py b/trunk/import/migration/tasks/collections.py index 1cb59ea..a22aad6 100644 --- a/trunk/import/migration/tasks/collections.py +++ b/trunk/import/migration/tasks/collections.py @@ -87,7 +87,7 @@ class CollectionsCopyMigrator(DataMigrator): self.step(offset) query = "INSERT INTO %s.media_collections (\n %s\n)\n" \ - "SELECT \n %s\n FROM %s.Support AS s LIMIT %d, 1" % ( + "SELECT \n %s\n FROM %s.Support AS s ORDER BY Cote LIMIT %d, 1" % ( self.target_db_name, ",\n ".join(target_fields), ",\n ".join(src_fields), @@ -100,7 +100,7 @@ class CollectionsCopyMigrator(DataMigrator): except IntegrityError, e: (errno, errmsg) = e if errno == DUP_ENTRY: - self.src_cursor.execute("SELECT Cote FROM %s.Support LIMIT %d, 1" % (self.src_db_name, offset)) + self.src_cursor.execute("SELECT Cote FROM %s.Support ORDER BY Cote LIMIT %d, 1" % (self.src_db_name, offset)) id = self.src_cursor.fetchone()[0] self.warn("Collection %s not imported: %s" % (id, errmsg)) self.stats['ignored'] += 1 -- 2.39.5