# HG changeset patch # User Sylvain Thénault # Date 1249486053 -7200 # Node ID ecf888c8a250dacad2d46f624c9c5d9537f7f32f # Parent 1025300249d2b2337d4a9ccc1f54d412ac9aa971 [migration] when adding a core meta-relation, it should be added to all entities *in the persistent schema*, not only those in the fs schema diff -r 1025300249d2 -r ecf888c8a250 server/migractions.py --- a/server/migractions.py Wed Aug 05 17:26:41 2009 +0200 +++ b/server/migractions.py Wed Aug 05 17:27:33 2009 +0200 @@ -694,6 +694,22 @@ self.commit() self.rqlexecall(ss.rdef2rql(rschema), ask_confirm=self.verbosity>=2) + if rtype in META_RTYPES: + # if the relation is in META_RTYPES, ensure we're adding it for + # all entity types *in the persistent schema*, not only those in + # the fs schema + for etype in self.repo.schema.entities(): + if not etype in self.fs_schema: + # get sample object type and rproperties + objtypes = rschema.objects() + assert len(objtypes) == 1 + objtype = objtypes[0] + props = rschema.rproperties( + rschema.subjects(objtype)[0], objtype) + assert props + self.rqlexecall(ss.rdef2rql(rschema, etype, objtype, props), + ask_confirm=self.verbosity>=2) + if commit: self.commit()