fix cwctl db-init -d on SQL Server stable
authorAlexandre Fayolle <alexandre.fayolle@logilab.fr>
Mon, 12 Apr 2010 15:05:37 +0000
branchstable
changeset 5214 3285b6e3b930
parent 5211 8fac9cd3c510
child 5215 b1327f19d23e
fix cwctl db-init -d on SQL Server
server/sources/native.py
server/sqlutils.py
--- a/server/sources/native.py	Sun Apr 11 11:59:45 2010 +0000
+++ b/server/sources/native.py	Mon Apr 12 15:05:37 2010 +0000
@@ -1248,9 +1248,9 @@
 %s
 DROP TABLE entities;
 DROP TABLE deleted_entities;
-DROP TABLE transactions;
 DROP TABLE tx_entity_actions;
 DROP TABLE tx_relation_actions;
+DROP TABLE transactions;
 """ % helper.sql_drop_sequence('entities_id_seq')
 
 
--- a/server/sqlutils.py	Sun Apr 11 11:59:45 2010 +0000
+++ b/server/sqlutils.py	Mon Apr 12 15:05:37 2010 +0000
@@ -113,8 +113,6 @@
     from cubicweb.server.sources import native
     output = []
     w = output.append
-    w(native.sql_drop_schema(driver))
-    w('')
     if text_index:
         dbhelper = db.get_db_helper(driver)
         w(dbhelper.sql_drop_fti())
@@ -122,6 +120,8 @@
     w(dropschema2sql(schema, prefix=SQL_PREFIX,
                      skip_entities=skip_entities,
                      skip_relations=skip_relations))
+    w('')
+    w(native.sql_drop_schema(driver))
     return '\n'.join(output)