]> git.parisson.com Git - telemeta-data.git/commitdiff
fix wrong reported ids in collections:copy task
authorolivier <olivier@3bf09e05-f825-4182-b9bc-eedd7160adf0>
Thu, 9 Jul 2009 10:20:48 +0000 (10:20 +0000)
committerolivier <olivier@3bf09e05-f825-4182-b9bc-eedd7160adf0>
Thu, 9 Jul 2009 10:20:48 +0000 (10:20 +0000)
git-svn-id: http://svn.parisson.org/svn/crem@119 3bf09e05-f825-4182-b9bc-eedd7160adf0

trunk/import/migration/tasks/collections.py

index 1cb59ea2a410fc06d706b1c40158482cbdc400b9..a22aad6d582330b3c35d60b0b08773b74a303275 100644 (file)
@@ -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