From 072ab2118fc86b7652bbc2d4dc0409103b7d9d50 Mon Sep 17 00:00:00 2001 From: Luke Sneeringer Date: Fri, 26 Sep 2014 14:08:19 -0500 Subject: [PATCH] Instance model (for HA) --- awx/main/migrations/0055_v210_changes.py | 2 +- awx/main/models/__init__.py | 1 + awx/main/models/ha.py | 18 ++++++++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 awx/main/models/ha.py diff --git a/awx/main/migrations/0055_v210_changes.py b/awx/main/migrations/0055_v210_changes.py index a383a1b875..c72ea2986e 100644 --- a/awx/main/migrations/0055_v210_changes.py +++ b/awx/main/migrations/0055_v210_changes.py @@ -476,4 +476,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['main'] \ No newline at end of file + complete_apps = ['main'] diff --git a/awx/main/models/__init__.py b/awx/main/models/__init__.py index 2f9d583a24..2d0e8cac4e 100644 --- a/awx/main/models/__init__.py +++ b/awx/main/models/__init__.py @@ -14,6 +14,7 @@ from awx.main.models.inventory import * from awx.main.models.jobs import * from awx.main.models.schedules import * from awx.main.models.activity_stream import * +from awx.main.models.ha import * # Monkeypatch Django serializer to ignore django-taggit fields (which break # the dumpdata command; see https://github.com/alex/django-taggit/issues/155). diff --git a/awx/main/models/ha.py b/awx/main/models/ha.py new file mode 100644 index 0000000000..40a7aed12c --- /dev/null +++ b/awx/main/models/ha.py @@ -0,0 +1,18 @@ +# Copyright (c) 2014 Ansible, Inc. +# All Rights Reserved. + +from django.db import models + + +class Instance(models.Model): + """A model representing an Ansible Tower instance, primary or secondary, + running against this database. + """ + uuid = models.CharField(max_length=40) + primary = models.BooleanField(default=False) + created = models.DateTimeField(auto_now_add=True) + modified = models.DateTimeField(auto_now=True) + + class Meta: + app_label = 'main' +