repaire cctl db-init -d on sqlserver (closes #1979670)
authorAlexandre Fayolle <alexandre.fayolle@logilab.fr>
Fri, 30 Sep 2011 18:10:28 +0200
changeset 7906 203d574c8a1d
parent 7901 bdb81b1a8243
child 7907 08320697ca1a
repaire cctl db-init -d on sqlserver (closes #1979670) requires an updated yams
__pkginfo__.py
debian/control
server/__init__.py
server/sqlutils.py
--- a/__pkginfo__.py	Tue Oct 04 10:21:05 2011 +0200
+++ b/__pkginfo__.py	Fri Sep 30 18:10:28 2011 +0200
@@ -43,7 +43,7 @@
     'logilab-common': '>= 0.56.3',
     'logilab-mtconverter': '>= 0.8.0',
     'rql': '>= 0.28.0',
-    'yams': '>= 0.33.0',
+    'yams': '>= 0.34.0',
     'docutils': '>= 0.6',
     #gettext                    # for xgettext, msgcat, etc...
     # web dependancies
--- a/debian/control	Tue Oct 04 10:21:05 2011 +0200
+++ b/debian/control	Fri Sep 30 18:10:28 2011 +0200
@@ -99,7 +99,7 @@
 Package: cubicweb-common
 Architecture: all
 XB-Python-Version: ${python:Versions}
-Depends: ${misc:Depends}, ${python:Depends}, graphviz, gettext, python-logilab-mtconverter (>= 0.8.0), python-logilab-common (>= 0.56.3), python-yams (>= 0.33.0), python-rql (>= 0.28.0), python-lxml
+Depends: ${misc:Depends}, ${python:Depends}, graphviz, gettext, python-logilab-mtconverter (>= 0.8.0), python-logilab-common (>= 0.56.3), python-yams (>= 0.34.0), python-rql (>= 0.28.0), python-lxml
 Recommends: python-simpletal (>= 4.0), python-crypto
 Conflicts: cubicweb-core
 Replaces: cubicweb-core
--- a/server/__init__.py	Tue Oct 04 10:21:05 2011 +0200
+++ b/server/__init__.py	Fri Sep 30 18:10:28 2011 +0200
@@ -148,20 +148,21 @@
     repo = Repository(config, vreg=vreg)
     schema = repo.schema
     sourcescfg = config.sources()
-    _title = '-> creating tables '
-    print _title,
     source = sourcescfg['system']
     driver = source['db-driver']
     sqlcnx = repo.system_source.get_connection()
     sqlcursor = sqlcnx.cursor()
     execute = sqlcursor.execute
     if drop:
+        _title = '-> drop tables '
         dropsql = sqldropschema(schema, driver)
         try:
-            sqlexec(dropsql, execute)
+            sqlexec(dropsql, execute, pbtitle=_title)
         except Exception, ex:
             print '-> drop failed, skipped (%s).' % ex
             sqlcnx.rollback()
+    _title = '-> creating tables '
+    print _title,
     # schema entities and relations tables
     # can't skip entities table even if system source doesn't support them,
     # they are used sometimes by generated sql. Keeping them empty is much
--- a/server/sqlutils.py	Tue Oct 04 10:21:05 2011 +0200
+++ b/server/sqlutils.py	Fri Sep 30 18:10:28 2011 +0200
@@ -129,7 +129,7 @@
         dbhelper = db.get_db_helper(driver)
         w(dbhelper.sql_drop_fti())
         w('')
-    w(dropschema2sql(schema, prefix=SQL_PREFIX,
+    w(dropschema2sql(dbhelper, schema, prefix=SQL_PREFIX,
                      skip_entities=skip_entities,
                      skip_relations=skip_relations))
     w('')