[migractions] fix change_attribute_type stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 20 May 2011 17:27:33 +0200
branchstable
changeset 7410 1dbf9a83bb49
parent 7409 47c8009dbbe2
child 7411 238da9684f99
[migractions] fix change_attribute_type
server/migractions.py
--- a/server/migractions.py	Fri May 20 17:27:15 2011 +0200
+++ b/server/migractions.py	Fri May 20 17:27:33 2011 +0200
@@ -1516,13 +1516,13 @@
         rschema = self.repo.schema.rschema(attr)
         oldtype = rschema.objects(etype)[0]
         rdefeid = rschema.rproperty(etype, oldtype, 'eid')
-        sql = ("UPDATE CWAttribute "
-               "SET to_entity=(SELECT eid FROM CWEType WHERE name='%s')"
-               "WHERE eid=%s") % (newtype, rdefeid)
+        sql = ("UPDATE cw_CWAttribute "
+               "SET cw_to_entity=(SELECT cw_eid FROM cw_CWEType WHERE cw_name='%s')"
+               "WHERE cw_eid=%s") % (newtype, rdefeid)
         self.sqlexec(sql, ask_confirm=False)
         dbhelper = self.repo.system_source.dbhelper
         sqltype = dbhelper.TYPE_MAPPING[newtype]
-        sql = 'ALTER TABLE %s ALTER COLUMN %s TYPE %s' % (etype, attr, sqltype)
+        sql = 'ALTER TABLE cw_%s ALTER COLUMN cw_%s TYPE %s' % (etype, attr, sqltype)
         self.sqlexec(sql, ask_confirm=False)
         if commit:
             self.commit()