From 2bba8b07fed49a984699285e3242cb9618a96fa0 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Fri, 12 Feb 2016 13:46:42 +0530 Subject: [PATCH] models: New model to store module setup versions --- plinth/migrations/0002_modulestore.py | 22 ++++++++++++++++++++++ plinth/models.py | 6 ++++++ 2 files changed, 28 insertions(+) create mode 100644 plinth/migrations/0002_modulestore.py diff --git a/plinth/migrations/0002_modulestore.py b/plinth/migrations/0002_modulestore.py new file mode 100644 index 000000000..43b81c064 --- /dev/null +++ b/plinth/migrations/0002_modulestore.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.2 on 2016-02-10 12:30 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('plinth', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='Module', + fields=[ + ('name', models.TextField(primary_key=True, serialize=False)), + ('setup_version', models.IntegerField()), + ], + ), + ] diff --git a/plinth/models.py b/plinth/models.py index 8dc1cfd03..bf2bf3350 100644 --- a/plinth/models.py +++ b/plinth/models.py @@ -37,3 +37,9 @@ class KVStore(models.Model): def value(self, val): """Store the value of the key/value pair by JSON encoding it""" self.value_json = json.dumps(val) + + +class Module(models.Model): + """Model to store current setup versions of a module.""" + name = models.TextField(primary_key=True) + setup_version = models.IntegerField()