misc/migration/bootstrapmigration_repository.py
branchstable
changeset 1952 8e19c813750d
parent 1501 c80ca83a382f
child 1954 9b20f3504af8
--- a/misc/migration/bootstrapmigration_repository.py	Wed May 27 11:19:37 2009 +0200
+++ b/misc/migration/bootstrapmigration_repository.py	Wed May 27 11:24:35 2009 +0200
@@ -7,6 +7,15 @@
 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
 """
 
+if applcubicwebversion < (3, 2, 2) and cubicwebversion >= (3, 2, 1):
+   from base64 import b64encode
+   for table in ('entities', 'deleted_entities'):
+      for eid, extid in sql('SELECT eid, extid FROM %s WHERE extid is NOT NULL'
+                            % table, ask_confirm=False):
+         sql('UPDATE %s SET extid=%%(extid)s WHERE eid=%%(eid)s' % table,
+             {'extid': b64encode(extid), 'eid': eid}, ask_confirm=False)
+   checkpoint()
+
 if applcubicwebversion < (3, 2, 0) and cubicwebversion >= (3, 2, 0):
    add_cube('card', update_database=False)