server/schemaserial.py
branchstable
changeset 2394 92bba46b853f
parent 2174 7f576dc9502e
child 2395 e3093fc12a00
equal deleted inserted replaced
2393:6190852af97f 2394:92bba46b853f
   275 
   275 
   276 def serialize_schema(cursor, schema, verbose=False):
   276 def serialize_schema(cursor, schema, verbose=False):
   277     """synchronize schema and permissions in the database according to
   277     """synchronize schema and permissions in the database according to
   278     current schema
   278     current schema
   279     """
   279     """
   280     print 'serializing the schema, this may take some time'
   280     print '-> storing the schema in the system source, this may take some time'
   281     eschemas = schema.entities()
   281     eschemas = schema.entities()
   282     aller = eschemas + schema.relations()
   282     aller = eschemas + schema.relations()
   283     if not verbose:
   283     if not verbose:
   284         pb_size = len(aller) + len(CONSTRAINTS) + len([x for x in eschemas if x.specializes()])
   284         pb_size = len(aller) + len(CONSTRAINTS) + len([x for x in eschemas if x.specializes()])
   285         pb = ProgressBar(pb_size)
   285         pb = ProgressBar(pb_size)