misc/migration/3.3.5_Any.py
author Sylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 25 Aug 2010 10:01:11 +0200
changeset 6140 65a619eb31c4
parent 2588 3a590ff82e99
child 8798 cdab3aadc679
permissions -rw-r--r--
[boxes] introduce new boxes system * separate box content generation from its layout * refactor css classes to allow moving boxes and still get consistent ui On the way to contentnavigation/boxes unification (in a later patch) * * * some fixes for the previous (default_new_boxes_system) patch * * * some fixes for the previous (default_new_boxes_system) patch
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2588
3a590ff82e99 [F schema serial] #344876: missing some 'is'/'is_instance_of' relation for newly created instances
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
     1
# some entities have been added before schema entities, fix the 'is' and
3a590ff82e99 [F schema serial] #344876: missing some 'is'/'is_instance_of' relation for newly created instances
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
     2
# 'is_instance_of' relations
3a590ff82e99 [F schema serial] #344876: missing some 'is'/'is_instance_of' relation for newly created instances
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
     3
for rtype in ('is', 'is_instance_of'):
3a590ff82e99 [F schema serial] #344876: missing some 'is'/'is_instance_of' relation for newly created instances
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
     4
    sql('INSERT INTO %s_relation '
3a590ff82e99 [F schema serial] #344876: missing some 'is'/'is_instance_of' relation for newly created instances
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
     5
        'SELECT X.eid, ET.cw_eid FROM entities as X, cw_CWEType as ET '
3a590ff82e99 [F schema serial] #344876: missing some 'is'/'is_instance_of' relation for newly created instances
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
     6
        'WHERE X.type=ET.cw_name AND NOT EXISTS('
3a590ff82e99 [F schema serial] #344876: missing some 'is'/'is_instance_of' relation for newly created instances
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
     7
        '      SELECT 1 from is_relation '
3a590ff82e99 [F schema serial] #344876: missing some 'is'/'is_instance_of' relation for newly created instances
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
     8
        '      WHERE eid_from=X.eid AND eid_to=ET.cw_eid)' % rtype)