diff options
author | Jonah BrĂ¼chert <jbb@kaidan.im> | 2024-05-23 04:03:00 +0200 |
---|---|---|
committer | Jonah BrĂ¼chert <jbb@kaidan.im> | 2024-05-23 04:31:59 +0200 |
commit | bb21feba15b062c5e4d17a400adea1049713c0f4 (patch) | |
tree | 751ece7e6329ee9349df28142a912c58cfb010ef /src/lib | |
parent | 5cd643861b48768a90788f9d6ad3bacf7566e586 (diff) | |
download | bcfg2-bb21feba15b062c5e4d17a400adea1049713c0f4.tar.gz bcfg2-bb21feba15b062c5e4d17a400adea1049713c0f4.tar.bz2 bcfg2-bb21feba15b062c5e4d17a400adea1049713c0f4.zip |
Adapt database migrations to current django API
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/Bcfg2/Server/Admin.py | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/lib/Bcfg2/Server/Admin.py b/src/lib/Bcfg2/Server/Admin.py index 30c04411a..8cdff9309 100644 --- a/src/lib/Bcfg2/Server/Admin.py +++ b/src/lib/Bcfg2/Server/Admin.py @@ -907,6 +907,7 @@ if HAS_DJANGO: class DBShell(_DjangoProxyCmd): """ Call the Django 'dbshell' command on the database """ + kwargs = {'database': 'Reporting'} class Shell(_DjangoProxyCmd): """ Call the Django 'shell' command on the database """ @@ -915,6 +916,11 @@ if HAS_DJANGO: """ Call the Django 'validate' command on the database """ command = "validate" + class Migrate(_DjangoProxyCmd): + """ Call the Django 'migrate' command on the database """ + command = "migrate" + kwargs = {'database': 'Reporting'} + class Syncdb(AdminCmd): """ Sync the Django ORM with the configured database """ @@ -932,16 +938,9 @@ if HAS_DJANGO: self.logger.error("Database update failed: %s" % err) raise SystemExit(1) - if django.VERSION[0] == 1 and django.VERSION[1] >= 7: - class Makemigrations(_DjangoProxyCmd): - """ Call the 'makemigrations' command on the database """ - args = ['Reporting'] - - else: - class Schemamigration(_DjangoProxyCmd): - """ Call the South 'schemamigration' command on the database """ - args = ['Bcfg2.Reporting'] - kwargs = {'auto': True} + class Makemigrations(_DjangoProxyCmd): + """ Call the 'makemigrations' command on the database """ + args = ['Reporting'] if HAS_REPORTS: |