|
1 """allways executed before all others in server migration |
|
2 |
|
3 it should only include low level schema changes |
|
4 |
|
5 :organization: Logilab |
|
6 :copyright: 2001-2008 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
|
7 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr |
|
8 """ |
|
9 |
|
10 if applcubicwebversion < (2, 47, 0) and cubicwebversion >= (2, 47, 0): |
|
11 from cubicweb.server import schemaserial |
|
12 schemaserial.HAS_FULLTEXT_CONTAINER = False |
|
13 cnx.set_shared_data('do-not-insert-is_instance_of', True) |
|
14 add_attribute('ERType', 'fulltext_container') |
|
15 schemaserial.HAS_FULLTEXT_CONTAINER = True |
|
16 |
|
17 |
|
18 |
|
19 if applcubicwebversion < (2, 50, 0) and cubicwebversion >= (2, 50, 0): |
|
20 cnx.set_shared_data('do-not-insert-is_instance_of', True) |
|
21 add_relation_type('is_instance_of') |
|
22 # fill the relation using an efficient sql query instead of using rql |
|
23 sql('INSERT INTO is_instance_of_relation ' |
|
24 ' SELECT * from is_relation') |
|
25 checkpoint() |
|
26 cnx.set_shared_data('do-not-insert-is_instance_of', False) |
|
27 |
|
28 if applcubicwebversion < (2, 42, 0) and cubicwebversion >= (2, 42, 0): |
|
29 sql('ALTER TABLE entities ADD COLUMN mtime TIMESTAMP') |
|
30 sql('UPDATE entities SET mtime=CURRENT_TIMESTAMP') |
|
31 sql('CREATE INDEX entities_mtime_idx ON entities(mtime)') |
|
32 sql('''CREATE TABLE deleted_entities ( |
|
33 eid INTEGER PRIMARY KEY NOT NULL, |
|
34 type VARCHAR(64) NOT NULL, |
|
35 source VARCHAR(64) NOT NULL, |
|
36 dtime TIMESTAMP NOT NULL, |
|
37 extid VARCHAR(256) |
|
38 )''') |
|
39 sql('CREATE INDEX deleted_entities_type_idx ON deleted_entities(type)') |
|
40 sql('CREATE INDEX deleted_entities_dtime_idx ON deleted_entities(dtime)') |
|
41 sql('CREATE INDEX deleted_entities_extid_idx ON deleted_entities(extid)') |
|
42 checkpoint() |
|
43 |