[schema synchronization] get back eid when adding a final entity type, else it may cause pb on later schema synchronization during the migration where the type is added stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 06 Apr 2011 09:57:28 +0200
branchstable
changeset 7181 e54ad6984e01
parent 7179 00548a4b22a6
child 7182 09454384fff8
[schema synchronization] get back eid when adding a final entity type, else it may cause pb on later schema synchronization during the migration where the type is added
hooks/syncschema.py
--- a/hooks/syncschema.py	Tue Apr 05 13:23:47 2011 +0200
+++ b/hooks/syncschema.py	Wed Apr 06 09:57:28 2011 +0200
@@ -912,6 +912,10 @@
     def __call__(self):
         entity = self.entity
         if entity.cw_edited.get('final'):
+            # final entity types don't need a table in the database and are
+            # systematically added by yams at initialization time so there is no
+            # need to do further processing. Simply assign its eid.
+            self._cw.vreg.schema[entity.name].eid = entity.eid
             return
         CWETypeAddOp(self._cw, entity=entity)