# HG changeset patch # User Sylvain Thénault # Date 1296038361 -3600 # Node ID 784d5df35af1273c4c3820332eafe8f5aa42c65d # Parent 32eb3185519609c6242985e1ca0abc0b9d88e052 [migration] cwunique constraint schema fix must be done in bootstrap migration diff -r 32eb31855196 -r 784d5df35af1 misc/migration/3.10.7_Any.py --- a/misc/migration/3.10.7_Any.py Wed Jan 26 10:50:38 2011 +0100 +++ b/misc/migration/3.10.7_Any.py Wed Jan 26 11:39:21 2011 +0100 @@ -1,9 +1,2 @@ -if not ('CWUniqueTogetherConstraint', 'CWRType') in schema['relations'].rdefs: - add_relation_definition('CWUniqueTogetherConstraint', 'relations', 'CWRType') - rql('SET C relations RT WHERE C relations RDEF, RDEF relation_type RT') - commit() - drop_relation_definition('CWUniqueTogetherConstraint', 'relations', 'CWAttribute') - drop_relation_definition('CWUniqueTogetherConstraint', 'relations', 'CWRelation') - add_attribute('TrInfo', 'tr_count') sync_schema_props_perms('TrInfo') diff -r 32eb31855196 -r 784d5df35af1 misc/migration/bootstrapmigration_repository.py --- a/misc/migration/bootstrapmigration_repository.py Wed Jan 26 10:50:38 2011 +0100 +++ b/misc/migration/bootstrapmigration_repository.py Wed Jan 26 11:39:21 2011 +0100 @@ -97,6 +97,14 @@ if applcubicwebversion < (3, 9, 6) and cubicwebversion >= (3, 9, 6): add_entity_type('CWUniqueTogetherConstraint') +if not ('CWUniqueTogetherConstraint', 'CWRType') in schema['relations'].rdefs: + add_relation_definition('CWUniqueTogetherConstraint', 'relations', 'CWRType') + rql('SET C relations RT WHERE C relations RDEF, RDEF relation_type RT') + commit() + drop_relation_definition('CWUniqueTogetherConstraint', 'relations', 'CWAttribute') + drop_relation_definition('CWUniqueTogetherConstraint', 'relations', 'CWRelation') + + if applcubicwebversion < (3, 4, 0) and cubicwebversion >= (3, 4, 0): with hooks_control(session, session.HOOKS_ALLOW_ALL, 'integrity'):