author | sylvain.thenault@logilab.fr |
Fri, 17 Apr 2009 16:55:37 +0200 | |
branch | tls-sprint |
changeset 1398 | 5fe84a5f7035 |
parent 0 | b97547f5f1fa |
child 1399 | 3f408c7a164e |
permissions | -rw-r--r-- |
0 | 1 |
"""allways executed before all others in server migration |
2 |
||
3 |
it should only include low level schema changes |
|
4 |
||
5 |
:organization: Logilab |
|
1398
5fe84a5f7035
rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents:
0
diff
changeset
|
6 |
:copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
0 | 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) |
|
1398
5fe84a5f7035
rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents:
0
diff
changeset
|
14 |
add_attribute('CWRType', 'fulltext_container') |
0 | 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 |