equal
deleted
inserted
replaced
1 # copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
1 # copyright 2003-2016 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
2 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr |
2 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr |
3 # |
3 # |
4 # This file is part of CubicWeb. |
4 # This file is part of CubicWeb. |
5 # |
5 # |
6 # CubicWeb is free software: you can redistribute it and/or modify it under the |
6 # CubicWeb is free software: you can redistribute it and/or modify it under the |
147 sqlexec(alter_table_sql) |
147 sqlexec(alter_table_sql) |
148 sqlexec('UPDATE entities SET type=%(n)s WHERE type=%(x)s', |
148 sqlexec('UPDATE entities SET type=%(n)s WHERE type=%(x)s', |
149 {'x': etype, 'n': netype}) |
149 {'x': etype, 'n': netype}) |
150 cnx.commit(False) |
150 cnx.commit(False) |
151 tocleanup = [eid] |
151 tocleanup = [eid] |
152 tocleanup += (eid for eid, cached in repo._type_source_cache.items() |
152 tocleanup += (eid for eid, cached in repo._type_extid_cache.items() |
153 if etype == cached[0]) |
153 if etype == cached[0]) |
154 repo.clear_caches(tocleanup) |
154 repo.clear_caches(tocleanup) |
155 cnx.commit(False) |
155 cnx.commit(False) |
156 if needcopy: |
156 if needcopy: |
157 ertidx[eid] = netype |
157 ertidx[eid] = netype |