cubicweb/server/repository.py
changeset 11129 97095348b3ee
parent 11090 b4b854c25de5
parent 11057 0b59724cb3f2
child 11195 5de859b95988
equal deleted inserted replaced
11128:9b4de34ad394 11129:97095348b3ee
   224         if config.quick_start or config.creating or not config.read_instance_schema:
   224         if config.quick_start or config.creating or not config.read_instance_schema:
   225             # load schema from the file system
   225             # load schema from the file system
   226             if not config.creating:
   226             if not config.creating:
   227                 self.info("set fs instance'schema")
   227                 self.info("set fs instance'schema")
   228             self.set_schema(config.load_schema(expand_cubes=True))
   228             self.set_schema(config.load_schema(expand_cubes=True))
       
   229             if not config.creating:
       
   230                 # set eids on entities schema
       
   231                 with self.internal_cnx() as cnx:
       
   232                     for etype, eid in cnx.execute('Any XN,X WHERE X is CWEType, X name XN'):
       
   233                         self.schema.eschema(etype).eid = eid
   229         else:
   234         else:
   230             # normal start: load the instance schema from the database
   235             # normal start: load the instance schema from the database
   231             self.info('loading schema from the repository')
   236             self.info('loading schema from the repository')
   232             self.set_schema(self.deserialize_schema())
   237             self.set_schema(self.deserialize_schema())
   233         # 3. initialize data sources
   238         # 3. initialize data sources