[migration/3.18] recover from bad CWSource.in_synchronization default value
authorJulien Cristau <julien.cristau@logilab.fr>
Thu, 16 Jan 2014 14:19:04 +0100
changeset 9414 d8c0784038f4
parent 9413 3861ebfd6aa8
child 9415 0ff1de2aa55d
[migration/3.18] recover from bad CWSource.in_synchronization default value The addition of this attribute in 3.13.8 had default=False, which made no sense, and was fixed in 3.13.9. However no migration was done so apps that ever saw the 3.13.8 code could still have '' as defaultval for this attribute.
misc/migration/3.18.0_Any.py
--- a/misc/migration/3.18.0_Any.py	Thu Jan 16 11:54:06 2014 +0100
+++ b/misc/migration/3.18.0_Any.py	Thu Jan 16 14:19:04 2014 +0100
@@ -7,6 +7,9 @@
 add_relation_definition('CWAttribute', 'add_permission', 'CWGroup')
 add_relation_definition('CWAttribute', 'add_permission', 'RQLExpression')
 
+# a bad defaultval in 3.13.8 schema was fixed in 3.13.9, but the migration was missed
+rql('SET ATTR defaultval NULL WHERE ATTR from_entity E, E name "CWSource", ATTR relation_type T, T name "in_synchronization"')
+
 # the migration gets confused when we change rdefs out from under it.  So
 # explicitly remove this size constraint so it doesn't stick around and break
 # things later.