cubicweb/misc/migration/3.24.0_Any.py
author Sylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 08 Nov 2016 18:37:47 +0100
branch3.24
changeset 11808 4a387179fa33
parent 11776 b49684ddd543
child 11890 01bfc50e1a47
permissions -rw-r--r--
[migration] Drop cw_schema relation first without this, we ends up with the traceback shown at https://www.cubicweb.org/ticket/16130960. This is not the proper fix, which I have not been able to find. It seems due to this very rare case of deletion of such relation linked to CWRType vs order of execution of operation (in this case, the operation deleting the entity table is run before some other queries using it). As forcing this relation to be deleted before the entity type fixes the problem while this case seems rare enough, IMO this patch is "good enough". Closes #16130960
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
11634
fa614537e5ee Add a CWSession entity.
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
     1
# Check the CW versions and add the entity only if needed ?
fa614537e5ee Add a CWSession entity.
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
     2
add_entity_type('CWSession')
11709
c16fe74d0a5f [migration] Drop cubicweb-pyramid CWProperty in 3.24.0 migration
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 11681
diff changeset
     3
rql('DELETE CWProperty X WHERE X pkey "system.version.pyramid"',
c16fe74d0a5f [migration] Drop cubicweb-pyramid CWProperty in 3.24.0 migration
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 11681
diff changeset
     4
    ask_confirm=False)
11757
e845746b4d3c [sources] Drop 'moved_entities' table handling
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 11709
diff changeset
     5
e845746b4d3c [sources] Drop 'moved_entities' table handling
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 11709
diff changeset
     6
sql('DROP TABLE moved_entities')
11773
054a947b5415 [repository] Drop the entities.asource column
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 11757
diff changeset
     7
sql('ALTER TABLE entities DROP COLUMN asource')
11774
51c160677afe [repository] Drop the entities.extid column and associated cache
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 11773
diff changeset
     8
sql('ALTER TABLE entities DROP COLUMN extid')
11776
b49684ddd543 [repository] Drop the index on entities.type
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 11775
diff changeset
     9
sql('DROP INDEX entities_type_idx')
11775
39cf9e55ada8 [source] Drop source mapping handling
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 11774
diff changeset
    10
11808
4a387179fa33 [migration] Drop cw_schema relation first
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 11776
diff changeset
    11
# force cw_schema deletion before CWSourceSchemaConfig to avoid nasty bug
4a387179fa33 [migration] Drop cw_schema relation first
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 11776
diff changeset
    12
drop_relation_type('cw_schema')
11775
39cf9e55ada8 [source] Drop source mapping handling
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 11774
diff changeset
    13
drop_entity_type('CWSourceSchemaConfig')