summaryrefslogtreecommitdiff
path: root/tko/migrations
diff options
context:
space:
mode:
authorshoward <showard@592f7852-d20e-0410-864c-8624ca9c26a4>2008-09-22 16:20:37 +0000
committershoward <showard@592f7852-d20e-0410-864c-8624ca9c26a4>2008-09-22 16:20:37 +0000
commit33a417b5f9ec1a57a87a6e9bf826de189da10ebe (patch)
tree5ebe7950241369fd5b54fa20fc45088e1d48cd8f /tko/migrations
parentdfcd9d7f9603c43911eb4f2c507f945cff8707ca (diff)
-add --force option to migrations to disable user confirmation because this can make migrations unscriptable
-add default migration dirs to migrate.py because having to cd to the right place was getting really annoying! -made monitor_db_unittest.py use migrations to initialize the test DB schema instead of copying the schema from the real DB, since that was creating problems for testing. this slows down the test considerably, but it's better than no testing at all (and we can improve it in the future). -made global_config allow overriding options, which is useful for testing Signed-off-by: Steve Howard <showard@google.com> git-svn-id: svn://test.kernel.org/autotest/trunk@2180 592f7852-d20e-0410-864c-8624ca9c26a4
Diffstat (limited to 'tko/migrations')
-rwxr-xr-xtko/migrations/001_initial_db.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/tko/migrations/001_initial_db.py b/tko/migrations/001_initial_db.py
index 065e5c5c..8b964753 100755
--- a/tko/migrations/001_initial_db.py
+++ b/tko/migrations/001_initial_db.py
@@ -12,12 +12,13 @@ def migrate_up(manager):
db_initialized = False
break
if not db_initialized:
- response = raw_input(
- 'Your tko database does not appear to be initialized. Do '
- 'you want to recreate it (this will result in loss of any '
- 'existing data) (yes/No)? ')
- if response != 'yes':
- raise Exception('User has chosen to abort migration')
+ if not manager.force:
+ response = raw_input(
+ 'Your autotest_web database does not appear to be '
+ 'initialized. Do you want to recreate it (this will '
+ 'result in loss of any existing data) (yes/No)? ')
+ if response != 'yes':
+ raise Exception('User has chosen to abort migration')
manager.execute_script(CREATE_DB_SQL)