Merge pull request #12288 from edx/jibsheet/paver-migrate-multiple-dbs

Switch to using the standard edxapp-migrate-(lms|cms) tools
This commit is contained in:
Kevin Falcone
2016-04-28 21:50:41 -04:00
2 changed files with 8 additions and 3 deletions

View File

@@ -155,7 +155,8 @@ class TestPaverServerTasks(PaverTestCase):
"""
settings = options.get("settings", "devstack")
call_task("pavelib.servers.update_db", options=options)
db_command = "python manage.py {server} --settings={settings} migrate --traceback --pythonpath=."
# pylint: disable=line-too-long
db_command = "NO_EDXAPP_SUDO=1 EDX_PLATFORM_SETTINGS_OVERRIDE={settings} /edx/bin/edxapp-migrate-{server} --traceback --pythonpath=. "
self.assertEquals(
self.task_messages,
[

View File

@@ -239,12 +239,16 @@ def run_all_servers(options):
])
def update_db(options):
"""
Runs syncdb and then migrate.
Migrates the lms and cms across all databases
"""
settings = getattr(options, 'settings', DEFAULT_SETTINGS)
fake = "--fake-initial" if getattr(options, 'fake_initial', False) else ""
for system in ('lms', 'cms'):
sh(django_cmd(system, settings, 'migrate', fake, '--traceback', '--pythonpath=.'))
# pylint: disable=line-too-long
sh("NO_EDXAPP_SUDO=1 EDX_PLATFORM_SETTINGS_OVERRIDE={settings} /edx/bin/edxapp-migrate-{system} --traceback --pythonpath=. {fake}".format(
settings=settings,
system=system,
fake=fake))
@task