From d7d90ca8626cae96d5aad3aac81967fa31cf7c4f Mon Sep 17 00:00:00 2001 From: Tim Laszlo Date: Tue, 29 Jan 2013 09:38:45 -0600 Subject: add old schema to migration --- tools/upgrade/1.3/migrate_dbstats.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tools/upgrade') diff --git a/tools/upgrade/1.3/migrate_dbstats.py b/tools/upgrade/1.3/migrate_dbstats.py index 15bd328f9..69d9514df 100755 --- a/tools/upgrade/1.3/migrate_dbstats.py +++ b/tools/upgrade/1.3/migrate_dbstats.py @@ -1,6 +1,7 @@ #!/usr/bin/env python import os +os.environ['BCFG2_LEGACY_MODELS'] = '1' os.environ['DJANGO_SETTINGS_MODULE'] = 'Bcfg2.settings' import sys @@ -217,6 +218,14 @@ def migrate_stage1(): def _restructure(): """major restructure of reporting data""" + # run any migrations from the previous schema + try: + from Bcfg2.Server.Reports.updatefix import update_database + update_database() + except: + logger.error("Failed to run legacy schema updates", exc_info=1) + return False + # try to avoid dangling transactions if not migrate_stage1(): return -- cgit v1.2.3-1-g7c22