author | sylvain.thenault@logilab.fr |
Thu, 02 Apr 2009 17:35:03 +0200 | |
changeset 1218 | 680a8fe589a8 |
parent 176 | 312024cbe717 |
child 1398 | 5fe84a5f7035 |
permissions | -rw-r--r-- |
0 | 1 |
from cubicweb import CW_MIGRATION_MAP |
2 |
||
3 |
for pk, in rql('Any K WHERE X is EProperty, X pkey IN (%s), X pkey K' |
|
176
312024cbe717
don't ask confirm
Sylvain Thenault <sylvain.thenault@logilab.fr>
parents:
138
diff
changeset
|
4 |
% ','.join("'system.version.%s'" % cube for cube in CW_MIGRATION_MAP), |
312024cbe717
don't ask confirm
Sylvain Thenault <sylvain.thenault@logilab.fr>
parents:
138
diff
changeset
|
5 |
ask_confirm=False): |
0 | 6 |
cube = pk.split('.')[-1] |
7 |
newk = pk.replace(cube, CW_MIGRATION_MAP[cube]) |
|
8 |
rql('SET X pkey %(newk)s WHERE X pkey %(oldk)s', |
|
176
312024cbe717
don't ask confirm
Sylvain Thenault <sylvain.thenault@logilab.fr>
parents:
138
diff
changeset
|
9 |
{'oldk': pk, 'newk': newk}, ask_confirm=False) |
0 | 10 |
print 'renamed', pk, 'to', newk |
113
1091d8d63f51
[doc] add a level for better structure
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
0
diff
changeset
|
11 |
|
1091d8d63f51
[doc] add a level for better structure
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
0
diff
changeset
|
12 |
add_entity_type('ECache') |