Borjan Tchakaloff | 08974d6 | 2018-02-19 16:02:20 +0100 | [diff] [blame] | 1 | # -*- coding: utf-8 -*- |
| 2 | # |
| 3 | # Introducing the RadioVersion and RadioVersionDaily models |
| 4 | from __future__ import unicode_literals |
| 5 | |
| 6 | from django.db import migrations, models |
| 7 | import django.db.models.deletion |
| 8 | |
| 9 | |
| 10 | class Migration(migrations.Migration): |
| 11 | |
| 12 | dependencies = [ |
Mitja Nikolaus | cb50f2c | 2018-08-24 13:54:48 +0200 | [diff] [blame] | 13 | ("crashreport_stats", "0002_version_and_versiondaily_with_defaults") |
Borjan Tchakaloff | 08974d6 | 2018-02-19 16:02:20 +0100 | [diff] [blame] | 14 | ] |
| 15 | |
| 16 | operations = [ |
| 17 | migrations.CreateModel( |
Mitja Nikolaus | cb50f2c | 2018-08-24 13:54:48 +0200 | [diff] [blame] | 18 | name="RadioVersion", |
Borjan Tchakaloff | 08974d6 | 2018-02-19 16:02:20 +0100 | [diff] [blame] | 19 | fields=[ |
Mitja Nikolaus | cb50f2c | 2018-08-24 13:54:48 +0200 | [diff] [blame] | 20 | ( |
| 21 | "id", |
| 22 | models.AutoField( |
| 23 | auto_created=True, |
| 24 | primary_key=True, |
| 25 | serialize=False, |
| 26 | verbose_name="ID", |
| 27 | ), |
| 28 | ), |
| 29 | ("is_official_release", models.BooleanField(default=False)), |
| 30 | ("is_beta_release", models.BooleanField(default=False)), |
| 31 | ("first_seen_on", models.DateField(auto_now_add=True)), |
| 32 | ("released_on", models.DateField(auto_now_add=True)), |
| 33 | ("heartbeats", models.IntegerField(default=0)), |
| 34 | ("prob_crashes", models.IntegerField(default=0)), |
| 35 | ("smpl", models.IntegerField(default=0)), |
| 36 | ("other", models.IntegerField(default=0)), |
| 37 | ( |
| 38 | "radio_version", |
| 39 | models.CharField(max_length=200, unique=True), |
| 40 | ), |
Borjan Tchakaloff | 08974d6 | 2018-02-19 16:02:20 +0100 | [diff] [blame] | 41 | ], |
Mitja Nikolaus | cb50f2c | 2018-08-24 13:54:48 +0200 | [diff] [blame] | 42 | options={"abstract": False}, |
Borjan Tchakaloff | 08974d6 | 2018-02-19 16:02:20 +0100 | [diff] [blame] | 43 | ), |
| 44 | migrations.CreateModel( |
Mitja Nikolaus | cb50f2c | 2018-08-24 13:54:48 +0200 | [diff] [blame] | 45 | name="RadioVersionDaily", |
Borjan Tchakaloff | 08974d6 | 2018-02-19 16:02:20 +0100 | [diff] [blame] | 46 | fields=[ |
Mitja Nikolaus | cb50f2c | 2018-08-24 13:54:48 +0200 | [diff] [blame] | 47 | ( |
| 48 | "id", |
| 49 | models.AutoField( |
| 50 | auto_created=True, |
| 51 | primary_key=True, |
| 52 | serialize=False, |
| 53 | verbose_name="ID", |
| 54 | ), |
| 55 | ), |
| 56 | ("date", models.DateField(auto_now_add=True)), |
| 57 | ("heartbeats", models.IntegerField(default=0)), |
| 58 | ("prob_crashes", models.IntegerField(default=0)), |
| 59 | ("smpl", models.IntegerField(default=0)), |
| 60 | ("other", models.IntegerField(default=0)), |
| 61 | ( |
| 62 | "version", |
| 63 | models.ForeignKey( |
| 64 | on_delete=django.db.models.deletion.CASCADE, |
| 65 | related_name="daily_stats", |
| 66 | to="crashreport_stats.RadioVersion", |
| 67 | ), |
| 68 | ), |
Borjan Tchakaloff | 08974d6 | 2018-02-19 16:02:20 +0100 | [diff] [blame] | 69 | ], |
Mitja Nikolaus | cb50f2c | 2018-08-24 13:54:48 +0200 | [diff] [blame] | 70 | options={"abstract": False}, |
Borjan Tchakaloff | 08974d6 | 2018-02-19 16:02:20 +0100 | [diff] [blame] | 71 | ), |
| 72 | ] |