Show More
@@ -61,13 +61,13 b' class DbManage(object):' | |||||
61 | init_model(engine) |
|
61 | init_model(engine) | |
62 | self.sa = meta.Session |
|
62 | self.sa = meta.Session | |
63 |
|
63 | |||
64 | def create_tables(self, override=False): |
|
64 | def create_tables(self, override=False, defaults={}): | |
65 | """ |
|
65 | """ | |
66 | Create a auth database |
|
66 | Create a auth database | |
67 | """ |
|
67 | """ | |
68 |
|
68 | quiet = defaults.get('quiet') | ||
69 | log.info("Any existing database is going to be destroyed") |
|
69 | log.info("Any existing database is going to be destroyed") | |
70 | if self.tests: |
|
70 | if self.tests or quiet: | |
71 | destroy = True |
|
71 | destroy = True | |
72 | else: |
|
72 | else: | |
73 | destroy = ask_ok('Are you sure to destroy old database ? [y/n]') |
|
73 | destroy = ask_ok('Are you sure to destroy old database ? [y/n]') |
@@ -38,7 +38,7 b' def setup_app(command, conf, vars):' | |||||
38 | dbconf = conf['sqlalchemy.db1.url'] |
|
38 | dbconf = conf['sqlalchemy.db1.url'] | |
39 | dbmanage = DbManage(log_sql=True, dbconf=dbconf, root=conf['here'], |
|
39 | dbmanage = DbManage(log_sql=True, dbconf=dbconf, root=conf['here'], | |
40 | tests=False) |
|
40 | tests=False) | |
41 | dbmanage.create_tables(override=True) |
|
41 | dbmanage.create_tables(override=True, defaults=command.options.__dict__) | |
42 | dbmanage.set_db_version() |
|
42 | dbmanage.set_db_version() | |
43 | opts = dbmanage.config_prompt(None, defaults=command.options.__dict__) |
|
43 | opts = dbmanage.config_prompt(None, defaults=command.options.__dict__) | |
44 | dbmanage.create_settings(opts) |
|
44 | dbmanage.create_settings(opts) |
General Comments 0
You need to be logged in to leave comments.
Login now