aboutsummaryrefslogtreecommitdiffstats
path: root/layerindex/migrations
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2016-11-07 12:15:12 +1300
committerPaul Eggleton <paul.eggleton@linux.intel.com>2016-11-16 15:31:46 +1300
commit43203c578ce856377751f9db7a0bf020ad8b0c5d (patch)
treee93cc76a084efa9a603b447c1a98cce5702e6325 /layerindex/migrations
parentcc1d82f893468faa4ae8157af5a63a3189c5f869 (diff)
downloadopenembedded-core-contrib-43203c578ce856377751f9db7a0bf020ad8b0c5d.tar.gz
Record and display update logs
At the moment it's a bit difficult to get update logs out of the environment in which the update script is being run. In order to make the logs more accessible, create a LayerUpdate model to record the output of update_layer.py separately for each layerbranch and tie the created LayerUpdates together with a single Update model per session. We provide two ways to look at this - a Tools->Updates page for logged-in users, and there's also an "Updates" tab on each layer that is accessible to anyone; which one is useful depends on whether you are looking at the index as a whole or an individual layer. Update records older than 30 days are deleted automatically by default. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Diffstat (limited to 'layerindex/migrations')
-rw-r--r--layerindex/migrations/0005_layerupdate.py46
1 files changed, 46 insertions, 0 deletions
diff --git a/layerindex/migrations/0005_layerupdate.py b/layerindex/migrations/0005_layerupdate.py
new file mode 100644
index 0000000000..3cf4ab208f
--- /dev/null
+++ b/layerindex/migrations/0005_layerupdate.py
@@ -0,0 +1,46 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('layerindex', '0004_layerdependency_required'),
+ ]
+
+ operations = [
+ migrations.CreateModel(
+ name='LayerUpdate',
+ fields=[
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('started', models.DateTimeField()),
+ ('finished', models.DateTimeField()),
+ ('errors', models.IntegerField(default=0)),
+ ('warnings', models.IntegerField(default=0)),
+ ('log', models.TextField(blank=True)),
+ ('layerbranch', models.ForeignKey(to='layerindex.LayerBranch')),
+ ],
+ ),
+ migrations.CreateModel(
+ name='Update',
+ fields=[
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('started', models.DateTimeField()),
+ ('finished', models.DateTimeField(null=True, blank=True)),
+ ('log', models.TextField(blank=True)),
+ ('reload', models.BooleanField(help_text='Was this update a reload?', verbose_name='Reloaded', default=False)),
+ ],
+ ),
+ migrations.AlterField(
+ model_name='branch',
+ name='name',
+ field=models.CharField(max_length=50, verbose_name='Branch name'),
+ ),
+ migrations.AddField(
+ model_name='layerupdate',
+ name='update',
+ field=models.ForeignKey(to='layerindex.Update'),
+ ),
+ ]