sync_schema_props_perms cleanup in migration script narval
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 09 Sep 2010 18:20:27 +0200
branchnarval
changeset 605 82603e1c2f94
parent 604 c9e83a2a1357
child 606 b74c17b45821
sync_schema_props_perms cleanup in migration script
migration/2.0.0_Any.py
--- a/migration/2.0.0_Any.py	Thu Sep 09 18:20:03 2010 +0200
+++ b/migration/2.0.0_Any.py	Thu Sep 09 18:20:27 2010 +0200
@@ -21,7 +21,6 @@
 rql('SET X computed_start_mode SM WHERE X start_mode SM, NOT X start_mode "inherited"')
 
 add_attribute('TestConfig', 'label') # except this one, dunno why
-sync_schema_props_perms('TestExecution')
 
 for tc in rqliter('Any X, XS, XC WHERE X is TestConfig, NOT X subpath NULL, '
                   'X subpath XS, X check_config XC').entities():
@@ -35,15 +34,6 @@
 process_script(os.path.join(os.path.dirname(__file__), 'create_recipes.py'))
 
 drop_attribute('TestConfig', 'checks')
-sync_schema_props_perms('TestConfig')
-
-
-for ertype in ('CheckResult', 'CheckResultInfo',
-               'using_config', 'during_execution',
-               'for_check', 'using_revision', 'log_file'):
-    sync_schema_props_perms(ertype, syncprops=False)
-
-sync_schema_props_perms('use_environment')
 
 for pe, tc, dpe in rqliter('Any PE,TC,DPE WHERE TC use_environment PE, TC needs_checkout DPE',
                            ask_confirm=True):
@@ -111,10 +101,15 @@
                  'eid': project.eid}, ask_confirm=True)
 commit()
 
-sync_schema_props_perms('local_repository')
 drop_attribute('ProjectEnvironment', 'vcs_repository')
 drop_attribute('ProjectEnvironment', 'vcs_repository_type')
-sync_schema_props_perms('Repository')
+
+sync_schema_props_perms('TestExecution')
+sync_schema_props_perms('TestConfig')
+sync_schema_props_perms('use_environment')
+sync_schema_props_perms('local_repository')
+for ertype in ('CheckResult', 'CheckResultInfo', 'Repository'):
+    sync_schema_props_perms(ertype, syncprops=False)
 
 rql('DELETE TestExecution TE WHERE TE branch NULL')