[server/initrepo] show failed sql statements and abort if necessary (closes #3308564)
--- a/server/__init__.py Wed Nov 27 16:18:54 2013 +0100
+++ b/server/__init__.py Thu Oct 24 18:28:18 2013 +0200
@@ -205,7 +205,11 @@
schemasql = sqlschema(schema, driver)
#skip_entities=[str(e) for e in schema.entities()
# if not repo.system_source.support_entity(str(e))])
- sqlexec(schemasql, execute, pbtitle=_title, delimiter=';;')
+ failed = sqlexec(schemasql, execute, pbtitle=_title, delimiter=';;')
+ if failed:
+ print 'The following SQL statements failed. You should check your schema.'
+ print failed
+ raise Exception('execution of the sql schema failed, you should check your schema')
sqlcursor.close()
sqlcnx.commit()
sqlcnx.close()