From 5b3ffd488a8b5f727a531a3b7c3ca419bb53d04e Mon Sep 17 00:00:00 2001 From: Tim Laszlo Date: Tue, 7 Aug 2012 13:37:33 -0500 Subject: Merge reporting configuration with main server configuration Admin/Syncdb: Use SchemaUpdater Move the schema update routines from reports to Bcfg2.Server Move Reports.settings into Bcfg2.settings --- src/lib/Bcfg2/Server/models.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/lib/Bcfg2/Server/models.py') diff --git a/src/lib/Bcfg2/Server/models.py b/src/lib/Bcfg2/Server/models.py index ba9ea761c..96a7261fd 100644 --- a/src/lib/Bcfg2/Server/models.py +++ b/src/lib/Bcfg2/Server/models.py @@ -60,3 +60,17 @@ def load_models(plugins=None, cfile='/etc/bcfg2.conf', quiet=True): # basic invocation to ensure that a default set of models is loaded, # and thus that this module will always work. load_models(quiet=True) + +# Monitor our internal db version +class InternalDatabaseVersion(models.Model): + """Object that tell us to witch version is the database.""" + version = models.IntegerField() + updated = models.DateTimeField(auto_now_add=True) + + def __str__(self): + return "version %d updated the %s" % (self.version, self.updated.isoformat()) + + class Meta: + app_label = "reports" + get_latest_by = "version" + -- cgit v1.2.3-1-g7c22