author | Sylvain Thénault <sylvain.thenault@logilab.fr> |
Mon, 18 May 2009 19:50:54 +0200 | |
branch | stable |
changeset 1853 | b1e3d8355d65 |
parent 1501 | c80ca83a382f |
child 1952 | 8e19c813750d |
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 |
||
1501
c80ca83a382f
migrate card cube in bootstrap migration
sylvain.thenault@logilab.fr
parents:
1399
diff
changeset
|
10 |
if applcubicwebversion < (3, 2, 0) and cubicwebversion >= (3, 2, 0): |
c80ca83a382f
migrate card cube in bootstrap migration
sylvain.thenault@logilab.fr
parents:
1399
diff
changeset
|
11 |
add_cube('card', update_database=False) |
c80ca83a382f
migrate card cube in bootstrap migration
sylvain.thenault@logilab.fr
parents:
1399
diff
changeset
|
12 |
|
0 | 13 |
if applcubicwebversion < (2, 47, 0) and cubicwebversion >= (2, 47, 0): |
14 |
from cubicweb.server import schemaserial |
|
15 |
schemaserial.HAS_FULLTEXT_CONTAINER = False |
|
1399
3f408c7a164e
unify schema sync migration commands with (hopefuly) a clearer name
sylvain.thenault@logilab.fr
parents:
1398
diff
changeset
|
16 |
session.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
|
17 |
add_attribute('CWRType', 'fulltext_container') |
0 | 18 |
schemaserial.HAS_FULLTEXT_CONTAINER = True |
19 |
||
20 |
||
1501
c80ca83a382f
migrate card cube in bootstrap migration
sylvain.thenault@logilab.fr
parents:
1399
diff
changeset
|
21 |
|
0 | 22 |
if applcubicwebversion < (2, 50, 0) and cubicwebversion >= (2, 50, 0): |
1399
3f408c7a164e
unify schema sync migration commands with (hopefuly) a clearer name
sylvain.thenault@logilab.fr
parents:
1398
diff
changeset
|
23 |
session.set_shared_data('do-not-insert-is_instance_of', True) |
0 | 24 |
add_relation_type('is_instance_of') |
25 |
# fill the relation using an efficient sql query instead of using rql |
|
26 |
sql('INSERT INTO is_instance_of_relation ' |
|
27 |
' SELECT * from is_relation') |
|
28 |
checkpoint() |
|
1399
3f408c7a164e
unify schema sync migration commands with (hopefuly) a clearer name
sylvain.thenault@logilab.fr
parents:
1398
diff
changeset
|
29 |
session.set_shared_data('do-not-insert-is_instance_of', False) |
0 | 30 |
|
31 |
if applcubicwebversion < (2, 42, 0) and cubicwebversion >= (2, 42, 0): |
|
32 |
sql('ALTER TABLE entities ADD COLUMN mtime TIMESTAMP') |
|
33 |
sql('UPDATE entities SET mtime=CURRENT_TIMESTAMP') |
|
34 |
sql('CREATE INDEX entities_mtime_idx ON entities(mtime)') |
|
35 |
sql('''CREATE TABLE deleted_entities ( |
|
36 |
eid INTEGER PRIMARY KEY NOT NULL, |
|
37 |
type VARCHAR(64) NOT NULL, |
|
38 |
source VARCHAR(64) NOT NULL, |
|
39 |
dtime TIMESTAMP NOT NULL, |
|
40 |
extid VARCHAR(256) |
|
41 |
)''') |
|
42 |
sql('CREATE INDEX deleted_entities_type_idx ON deleted_entities(type)') |
|
43 |
sql('CREATE INDEX deleted_entities_dtime_idx ON deleted_entities(dtime)') |
|
44 |
sql('CREATE INDEX deleted_entities_extid_idx ON deleted_entities(extid)') |
|
45 |
checkpoint() |
|
1501
c80ca83a382f
migrate card cube in bootstrap migration
sylvain.thenault@logilab.fr
parents:
1399
diff
changeset
|
46 |