misc/migration/bootstrapmigration_repository.py
branchtls-sprint
changeset 1399 3f408c7a164e
parent 1398 5fe84a5f7035
child 1501 c80ca83a382f
equal deleted inserted replaced
1398:5fe84a5f7035 1399:3f408c7a164e
     8 """
     8 """
     9 
     9 
    10 if applcubicwebversion < (2, 47, 0) and cubicwebversion >= (2, 47, 0):
    10 if applcubicwebversion < (2, 47, 0) and cubicwebversion >= (2, 47, 0):
    11     from cubicweb.server import schemaserial
    11     from cubicweb.server import schemaserial
    12     schemaserial.HAS_FULLTEXT_CONTAINER = False
    12     schemaserial.HAS_FULLTEXT_CONTAINER = False
    13     cnx.set_shared_data('do-not-insert-is_instance_of', True)
    13     session.set_shared_data('do-not-insert-is_instance_of', True)
    14     add_attribute('CWRType', 'fulltext_container')
    14     add_attribute('CWRType', 'fulltext_container')
    15     schemaserial.HAS_FULLTEXT_CONTAINER = True
    15     schemaserial.HAS_FULLTEXT_CONTAINER = True
    16 
    16 
    17 
    17 
    18  
    18  
    19 if applcubicwebversion < (2, 50, 0) and cubicwebversion >= (2, 50, 0):
    19 if applcubicwebversion < (2, 50, 0) and cubicwebversion >= (2, 50, 0):
    20     cnx.set_shared_data('do-not-insert-is_instance_of', True)
    20     session.set_shared_data('do-not-insert-is_instance_of', True)
    21     add_relation_type('is_instance_of')
    21     add_relation_type('is_instance_of')
    22     # fill the relation using an efficient sql query instead of using rql
    22     # fill the relation using an efficient sql query instead of using rql
    23     sql('INSERT INTO is_instance_of_relation '
    23     sql('INSERT INTO is_instance_of_relation '
    24 	'  SELECT * from is_relation')
    24 	'  SELECT * from is_relation')
    25     checkpoint()
    25     checkpoint()
    26     cnx.set_shared_data('do-not-insert-is_instance_of', False)
    26     session.set_shared_data('do-not-insert-is_instance_of', False)
    27 
    27 
    28 if applcubicwebversion < (2, 42, 0) and cubicwebversion >= (2, 42, 0):
    28 if applcubicwebversion < (2, 42, 0) and cubicwebversion >= (2, 42, 0):
    29     sql('ALTER TABLE entities ADD COLUMN mtime TIMESTAMP')
    29     sql('ALTER TABLE entities ADD COLUMN mtime TIMESTAMP')
    30     sql('UPDATE entities SET mtime=CURRENT_TIMESTAMP')
    30     sql('UPDATE entities SET mtime=CURRENT_TIMESTAMP')
    31     sql('CREATE INDEX entities_mtime_idx ON entities(mtime)')
    31     sql('CREATE INDEX entities_mtime_idx ON entities(mtime)')