Changeset - 957329c1c35b
[Not reviewed]
beta
0 2 0
Marcin Kuzminski - 13 years ago 2012-07-21 23:25:26
marcin@python-works.com
implements #507 setup-rhodecode always presents interactive prompt to destroy database, now -q flag fixes that
2 files changed with 4 insertions and 4 deletions:
0 comments (0 inline, 0 general)
rhodecode/lib/db_manage.py
Show inline comments
 
@@ -61,13 +61,13 @@ class DbManage(object):
 
        init_model(engine)
 
        self.sa = meta.Session
 

	
 
    def create_tables(self, override=False):
 
    def create_tables(self, override=False, defaults={}):
 
        """
 
        Create a auth database
 
        """
 

	
 
        quiet = defaults.get('quiet')
 
        log.info("Any existing database is going to be destroyed")
 
        if self.tests:
 
        if self.tests or quiet:
 
            destroy = True
 
        else:
 
            destroy = ask_ok('Are you sure to destroy old database ? [y/n]')
rhodecode/websetup.py
Show inline comments
 
@@ -38,7 +38,7 @@ def setup_app(command, conf, vars):
 
    dbconf = conf['sqlalchemy.db1.url']
 
    dbmanage = DbManage(log_sql=True, dbconf=dbconf, root=conf['here'],
 
                        tests=False)
 
    dbmanage.create_tables(override=True)
 
    dbmanage.create_tables(override=True, defaults=command.options.__dict__)
 
    dbmanage.set_db_version()
 
    opts = dbmanage.config_prompt(None, defaults=command.options.__dict__)
 
    dbmanage.create_settings(opts)
0 comments (0 inline, 0 general)