server/sqlutils.py
branchstable
changeset 5214 3285b6e3b930
parent 5013 ad91f93bbb93
child 5421 8167de96c523
equal deleted inserted replaced
5211:8fac9cd3c510 5214:3285b6e3b930
   111     """return the sql to drop the schema, according to the given parameters"""
   111     """return the sql to drop the schema, according to the given parameters"""
   112     from yams.schema2sql import dropschema2sql
   112     from yams.schema2sql import dropschema2sql
   113     from cubicweb.server.sources import native
   113     from cubicweb.server.sources import native
   114     output = []
   114     output = []
   115     w = output.append
   115     w = output.append
   116     w(native.sql_drop_schema(driver))
       
   117     w('')
       
   118     if text_index:
   116     if text_index:
   119         dbhelper = db.get_db_helper(driver)
   117         dbhelper = db.get_db_helper(driver)
   120         w(dbhelper.sql_drop_fti())
   118         w(dbhelper.sql_drop_fti())
   121         w('')
   119         w('')
   122     w(dropschema2sql(schema, prefix=SQL_PREFIX,
   120     w(dropschema2sql(schema, prefix=SQL_PREFIX,
   123                      skip_entities=skip_entities,
   121                      skip_entities=skip_entities,
   124                      skip_relations=skip_relations))
   122                      skip_relations=skip_relations))
       
   123     w('')
       
   124     w(native.sql_drop_schema(driver))
   125     return '\n'.join(output)
   125     return '\n'.join(output)
   126 
   126 
   127 
   127 
   128 class SQLAdapterMixIn(object):
   128 class SQLAdapterMixIn(object):
   129     """Mixin for SQL data sources, getting a connection from a configuration
   129     """Mixin for SQL data sources, getting a connection from a configuration