misc/migration/2.99.0_Any.py
changeset 176 312024cbe717
parent 138 ed8a7efaadb6
child 1398 5fe84a5f7035
equal deleted inserted replaced
175:5c7bb5f1ede0 176:312024cbe717
     1 from cubicweb import CW_MIGRATION_MAP
     1 from cubicweb import CW_MIGRATION_MAP
     2 
     2 
     3 for pk, in rql('Any K WHERE X is EProperty, X pkey IN (%s), X pkey K'
     3 for pk, in rql('Any K WHERE X is EProperty, X pkey IN (%s), X pkey K'
     4               % ','.join("'system.version.%s'" % cube for cube in CW_MIGRATION_MAP)):
     4                % ','.join("'system.version.%s'" % cube for cube in CW_MIGRATION_MAP),
       
     5                ask_confirm=False):
     5     cube = pk.split('.')[-1]
     6     cube = pk.split('.')[-1]
     6     newk = pk.replace(cube, CW_MIGRATION_MAP[cube])
     7     newk = pk.replace(cube, CW_MIGRATION_MAP[cube])
     7     rql('SET X pkey %(newk)s WHERE X pkey %(oldk)s',
     8     rql('SET X pkey %(newk)s WHERE X pkey %(oldk)s',
     8         {'oldk': pk, 'newk': newk})
     9         {'oldk': pk, 'newk': newk}, ask_confirm=False)
     9     print 'renamed', pk, 'to', newk
    10     print 'renamed', pk, 'to', newk
    10 
    11 
    11 add_entity_type('ECache')
    12 add_entity_type('ECache')