misc/migration/3.21.0_Any.py
author Rémi Cardona <remi.cardona@logilab.fr>
Wed, 13 May 2015 18:39:29 +0200
changeset 10425 4be5dd6ac4e2
parent 10371 88577b10b31e
child 10448 de5be53e2ea8
permissions -rw-r--r--
[devtools] qunit: remove useless window.close() Modern browsers don't allow it anymore. Related to #5533333.


helper = repo.system_source.dbhelper
sql('DROP INDEX entities_extid_idx')
sql(helper.sql_create_index('entities', 'extid', True))

sql('''
CREATE TABLE moved_entities (
  eid INTEGER PRIMARY KEY NOT NULL,
  extid VARCHAR(256) UNIQUE
)
''')

moved_entities = sql('SELECT -eid, extid FROM entities WHERE eid < 0')
cu = session.cnxset.cu
cu.executemany('INSERT INTO moved_entities (eid, extid) VALUES (%s, %s)',
               moved_entities)
sql('DELETE FROM entities WHERE eid < 0')

commit()

sync_schema_props_perms('CWEType')

sync_schema_props_perms('cwuri')