summaryrefslogtreecommitdiff
path: root/main/migrations/0001_initial.py
blob: 8349d4b97de384ef8e88a800f22d9c3bca4a7a4d (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
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations
import main.fields
import django.db.models.deletion
from django.conf import settings


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Arch',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('name', models.CharField(unique=True, max_length=255)),
                ('agnostic', models.BooleanField(default=False, help_text=b'Is this architecture non-platform specific?')),
                ('required_signoffs', models.PositiveIntegerField(default=2, help_text=b'Number of signoffs required for packages of this architecture')),
            ],
            options={
                'ordering': ('name',),
                'db_table': 'arches',
                'verbose_name_plural': 'arches',
            },
            bases=(models.Model,),
        ),
        migrations.CreateModel(
            name='Donor',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('name', models.CharField(unique=True, max_length=255)),
                ('visible', models.BooleanField(default=True, help_text=b'Should we show this donor on the public page?')),
                ('created', models.DateTimeField()),
            ],
            options={
                'ordering': ('name',),
                'db_table': 'donors',
                'get_latest_by': 'created',
            },
            bases=(models.Model,),
        ),
        migrations.CreateModel(
            name='Package',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('pkgname', models.CharField(max_length=255)),
                ('pkgbase', models.CharField(max_length=255, db_index=True)),
                ('pkgver', models.CharField(max_length=255)),
                ('pkgrel', models.CharField(max_length=255)),
                ('epoch', models.PositiveIntegerField(default=0)),
                ('pkgdesc', models.TextField(null=True, verbose_name=b'description')),
                ('url', models.CharField(max_length=255, null=True, verbose_name=b'URL')),
                ('filename', models.CharField(max_length=255)),
                ('compressed_size', main.fields.PositiveBigIntegerField()),
                ('installed_size', main.fields.PositiveBigIntegerField()),
                ('build_date', models.DateTimeField(null=True)),
                ('last_update', models.DateTimeField(db_index=True)),
                ('files_last_update', models.DateTimeField(null=True, blank=True)),
                ('created', models.DateTimeField()),
                ('packager_str', models.CharField(max_length=255, verbose_name=b'packager string')),
                ('signature_bytes', models.BinaryField(verbose_name=b'PGP signature', null=True)),
                ('flag_date', models.DateTimeField(null=True, blank=True)),
                ('arch', models.ForeignKey(related_name=b'packages', on_delete=django.db.models.deletion.PROTECT, to='main.Arch')),
                ('packager', models.ForeignKey(on_delete=django.db.models.deletion.SET_NULL, blank=True, to=settings.AUTH_USER_MODEL, null=True)),
            ],
            options={
                'ordering': ('pkgname',),
                'db_table': 'packages',
                'get_latest_by': 'last_update',
            },
            bases=(models.Model,),
        ),
        migrations.CreateModel(
            name='PackageFile',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('is_directory', models.BooleanField(default=False)),
                ('directory', models.CharField(max_length=1024)),
                ('filename', models.CharField(max_length=1024, null=True, blank=True)),
                ('pkg', models.ForeignKey(to='main.Package')),
            ],
            options={
                'db_table': 'package_files',
            },
            bases=(models.Model,),
        ),
        migrations.CreateModel(
            name='Repo',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('name', models.CharField(unique=True, max_length=255)),
                ('testing', models.BooleanField(default=False, help_text=b'Is this repo meant for package testing?')),
                ('staging', models.BooleanField(default=False, help_text=b'Is this repo meant for package staging?')),
                ('bugs_project', models.SmallIntegerField(default=1, help_text=b'Flyspray project ID for this repository.')),
                ('bugs_category', models.SmallIntegerField(default=2, help_text=b'Flyspray category ID for this repository.')),
                ('svn_root', models.CharField(help_text=b'SVN root (e.g. path) for this repository.', max_length=64)),
            ],
            options={
                'ordering': ('name',),
                'db_table': 'repos',
            },
            bases=(models.Model,),
        ),
        migrations.AddField(
            model_name='package',
            name='repo',
            field=models.ForeignKey(related_name=b'packages', on_delete=django.db.models.deletion.PROTECT, to='main.Repo'),
            preserve_default=True,
        ),
        migrations.AlterUniqueTogether(
            name='package',
            unique_together=set([('pkgname', 'repo', 'arch')]),
        ),
    ]