misc/migration/3.18.0_Any.py
branchstable
changeset 9589 7e4897901c64
parent 9477 07fc991612b0
child 9635 aaf099172bb9
child 10055 b23043546f2c
equal deleted inserted replaced
9588:fe267b7336f3 9589:7e4897901c64
    72 
    72 
    73 # Set object type to "Bytes" for CWAttribute's "defaultval" attribute
    73 # Set object type to "Bytes" for CWAttribute's "defaultval" attribute
    74 rql('SET X to_entity B WHERE X is CWAttribute, X from_entity Y, Y name "CWAttribute", '
    74 rql('SET X to_entity B WHERE X is CWAttribute, X from_entity Y, Y name "CWAttribute", '
    75     'X relation_type Z, Z name "defaultval", B name "Bytes", NOT X to_entity B')
    75     'X relation_type Z, Z name "defaultval", B name "Bytes", NOT X to_entity B')
    76 
    76 
    77 schema['defaultval'].rdefs.values()[0].object = schema['Bytes']
    77 oldrdef = schema['CWAttribute'].rdef('defaultval')
       
    78 import yams.buildobjs as ybo
       
    79 newrdef = ybo.RelationDefinition('CWAttribute', 'defaultval', 'Bytes')
       
    80 newrdef.eid = oldrdef.eid
       
    81 schema.add_relation_def(newrdef)
       
    82 schema.del_relation_def('CWAttribute', 'defaultval', 'String')
    78 
    83 
    79 commit()
    84 commit()
    80 
    85 
    81 sync_schema_props_perms('defaultval')
    86 sync_schema_props_perms('defaultval')
    82 
    87