summaryrefslogtreecommitdiff
path: root/mirrors/migrations/0001_initial.py
blob: 6f36c9ebc94742fc829ea2b3a3640301060390fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations
import django_countries.fields
import django.db.models.deletion
import mirrors.fields


class Migration(migrations.Migration):

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='CheckLocation',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('hostname', models.CharField(max_length=255)),
                ('source_ip', models.GenericIPAddressField(unique=True, verbose_name=b'source IP', unpack_ipv4=True)),
                ('country', django_countries.fields.CountryField(max_length=2)),
                ('created', models.DateTimeField(editable=False)),
            ],
            options={
                'ordering': ('hostname', 'source_ip'),
            },
            bases=(models.Model,),
        ),
        migrations.CreateModel(
            name='Mirror',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('name', models.CharField(unique=True, max_length=255)),
                ('tier', models.SmallIntegerField(default=2, choices=[(0, b'Tier 0'), (1, b'Tier 1'), (2, b'Tier 2'), (-1, b'Untiered')])),
                ('admin_email', models.EmailField(max_length=255, blank=True)),
                ('alternate_email', models.EmailField(max_length=255, blank=True)),
                ('public', models.BooleanField(default=True)),
                ('active', models.BooleanField(default=True)),
                ('isos', models.BooleanField(default=True, verbose_name=b'ISOs')),
                ('rsync_user', models.CharField(default=b'', max_length=50, blank=True)),
                ('rsync_password', models.CharField(default=b'', max_length=50, blank=True)),
                ('bug', models.PositiveIntegerField(null=True, verbose_name=b'Flyspray bug', blank=True)),
                ('notes', models.TextField(blank=True)),
                ('created', models.DateTimeField(editable=False)),
                ('last_modified', models.DateTimeField(editable=False)),
                ('upstream', models.ForeignKey(on_delete=django.db.models.deletion.SET_NULL, to='mirrors.Mirror', null=True)),
            ],
            options={
                'ordering': ('name',),
            },
            bases=(models.Model,),
        ),
        migrations.CreateModel(
            name='MirrorLog',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('check_time', models.DateTimeField(db_index=True)),
                ('last_sync', models.DateTimeField(null=True)),
                ('duration', models.FloatField(null=True)),
                ('is_success', models.BooleanField(default=True)),
                ('error', models.TextField(default=b'', blank=True)),
                ('location', models.ForeignKey(related_name=b'logs', to='mirrors.CheckLocation', null=True)),
            ],
            options={
                'get_latest_by': 'check_time',
                'verbose_name': 'mirror check log',
            },
            bases=(models.Model,),
        ),
        migrations.CreateModel(
            name='MirrorProtocol',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('protocol', models.CharField(unique=True, max_length=10)),
                ('is_download', models.BooleanField(default=True, help_text=b'Is protocol useful for end-users, e.g. HTTP')),
                ('default', models.BooleanField(default=True, help_text=b'Included by default when building mirror list?')),
                ('created', models.DateTimeField(editable=False)),
            ],
            options={
                'ordering': ('protocol',),
            },
            bases=(models.Model,),
        ),
        migrations.CreateModel(
            name='MirrorRsync',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('ip', mirrors.fields.IPNetworkField(max_length=44, verbose_name=b'IP')),
                ('created', models.DateTimeField(editable=False)),
                ('mirror', models.ForeignKey(related_name=b'rsync_ips', to='mirrors.Mirror')),
            ],
            options={
                'ordering': ('ip',),
                'verbose_name': 'mirror rsync IP',
            },
            bases=(models.Model,),
        ),
        migrations.CreateModel(
            name='MirrorUrl',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('url', models.CharField(unique=True, max_length=255, verbose_name=b'URL')),
                ('country', django_countries.fields.CountryField(blank=True, max_length=2, db_index=True)),
                ('has_ipv4', models.BooleanField(default=True, verbose_name=b'IPv4 capable', editable=False)),
                ('has_ipv6', models.BooleanField(default=False, verbose_name=b'IPv6 capable', editable=False)),
                ('created', models.DateTimeField(editable=False)),
                ('active', models.BooleanField(default=True)),
                ('mirror', models.ForeignKey(related_name=b'urls', to='mirrors.Mirror')),
                ('protocol', models.ForeignKey(related_name=b'urls', on_delete=django.db.models.deletion.PROTECT, editable=False, to='mirrors.MirrorProtocol')),
            ],
            options={
                'verbose_name': 'mirror URL',
            },
            bases=(models.Model,),
        ),
        migrations.AddField(
            model_name='mirrorlog',
            name='url',
            field=models.ForeignKey(related_name=b'logs', to='mirrors.MirrorUrl'),
            preserve_default=True,
        ),
    ]