1# -*- coding: utf-8 -*-
3from django.db import models, migrations
4import jsonfield.fields
5import distro_tracker.core.models
6import django.db.models.deletion
7from django.conf import settings
8import distro_tracker.core.utils
11class Migration(migrations.Migration):
13 dependencies = [
14 migrations.swappable_dependency(settings.AUTH_USER_MODEL),
15 ('django_email_accounts', '__first__'),
16 ]
18 operations = [
19 migrations.CreateModel(
20 name='ActionItem',
21 fields=[
22 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
23 ('short_description', models.TextField()),
24 ('severity', models.IntegerField(default=2, choices=[(0, 'wishlist'), (1, 'low'), (2, 'normal'), (3, 'high'), (4, 'critical')])),
25 ('created_timestamp', models.DateTimeField(auto_now_add=True)),
26 ('last_updated_timestamp', models.DateTimeField(auto_now=True)),
27 ('extra_data', jsonfield.fields.JSONField(null=True, blank=True)),
28 ],
29 options={
30 },
31 bases=(models.Model,),
32 ),
33 migrations.CreateModel(
34 name='ActionItemType',
35 fields=[
36 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
37 ('type_name', models.TextField(unique=True, max_length=100)),
38 ('full_description_template', models.CharField(max_length=255, null=True, blank=True)),
39 ],
40 options={
41 },
42 bases=(models.Model,),
43 ),
44 migrations.CreateModel(
45 name='Architecture',
46 fields=[
47 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
48 ('name', models.CharField(unique=True, max_length=30)),
49 ],
50 options={
51 },
52 bases=(models.Model,),
53 ),
54 migrations.CreateModel(
55 name='BinaryPackage',
56 fields=[
57 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
58 ('version', models.CharField(max_length=50, null=True)),
59 ('short_description', models.CharField(max_length=300, blank=True)),
60 ('long_description', models.TextField(blank=True)),
61 ],
62 options={
63 },
64 bases=(models.Model,),
65 ),
66 migrations.CreateModel(
67 name='BinaryPackageBugStats',
68 fields=[
69 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
70 ('stats', jsonfield.fields.JSONField(default=dict, blank=True)),
71 ],
72 options={
73 },
74 bases=(models.Model,),
75 ),
76 migrations.CreateModel(
77 name='BinaryPackageRepositoryEntry',
78 fields=[
79 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
80 ('priority', models.CharField(max_length=50, blank=True)),
81 ('section', models.CharField(max_length=50, blank=True)),
82 ('architecture', models.ForeignKey(to='core.Architecture', on_delete=models.CASCADE)),
83 ('binary_package', models.ForeignKey(related_name='repository_entries', to='core.BinaryPackage', on_delete=models.CASCADE)),
84 ],
85 options={
86 },
87 bases=(models.Model,),
88 ),
89 migrations.CreateModel(
90 name='ContributorName',
91 fields=[
92 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
93 ('name', models.CharField(max_length=60, blank=True)),
94 ('contributor_email', models.ForeignKey(to='django_email_accounts.UserEmail', on_delete=models.CASCADE)),
95 ],
96 options={
97 },
98 bases=(models.Model,),
99 ),
100 migrations.CreateModel(
101 name='EmailSettings',
102 fields=[
103 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
104 ],
105 options={
106 },
107 bases=(models.Model,),
108 ),
109 migrations.CreateModel(
110 name='ExtractedSourceFile',
111 fields=[
112 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
113 ('extracted_file', models.FileField(upload_to=distro_tracker.core.models._extracted_source_file_upload_path)),
114 ('name', models.CharField(max_length=100)),
115 ('date_extracted', models.DateTimeField(auto_now_add=True)),
116 ],
117 options={
118 },
119 bases=(models.Model,),
120 ),
121 migrations.CreateModel(
122 name='Keyword',
123 fields=[
124 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
125 ('name', models.CharField(unique=True, max_length=50)),
126 ('default', models.BooleanField(default=False)),
127 ],
128 options={
129 },
130 bases=(models.Model,),
131 ),
132 migrations.CreateModel(
133 name='MailingList',
134 fields=[
135 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
136 ('name', models.CharField(max_length=100)),
137 ('domain', models.CharField(unique=True, max_length=255)),
138 ('archive_url_template', models.CharField(max_length=255, validators=[distro_tracker.core.models.validate_archive_url_template])),
139 ],
140 options={
141 },
142 bases=(models.Model,),
143 ),
144 migrations.CreateModel(
145 name='MembershipConfirmation',
146 fields=[
147 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
148 ('confirmation_key', models.CharField(unique=True, max_length=40)),
149 ('date_created', models.DateTimeField(auto_now_add=True)),
150 ],
151 options={
152 'abstract': False,
153 },
154 bases=(models.Model,),
155 ),
156 migrations.CreateModel(
157 name='MembershipPackageSpecifics',
158 fields=[
159 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
160 ('_has_keywords', models.BooleanField(default=False)),
161 ('muted', models.BooleanField(default=False)),
162 ('keywords', models.ManyToManyField(to='core.Keyword')),
163 ],
164 options={
165 },
166 bases=(models.Model,),
167 ),
168 migrations.CreateModel(
169 name='News',
170 fields=[
171 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
172 ('title', models.CharField(max_length=255)),
173 ('content_type', models.CharField(default='text/plain', max_length=100)),
174 ('_db_content', models.TextField(null=True, blank=True)),
175 ('news_file', models.FileField(upload_to=distro_tracker.core.models.news_upload_path, blank=True)),
176 ('created_by', models.CharField(max_length=100, blank=True)),
177 ('datetime_created', models.DateTimeField(auto_now_add=True)),
178 ],
179 options={
180 },
181 bases=(models.Model,),
182 ),
183 migrations.CreateModel(
184 name='PackageBugStats',
185 fields=[
186 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
187 ('stats', jsonfield.fields.JSONField(default=dict, blank=True)),
188 ],
189 options={
190 },
191 bases=(models.Model,),
192 ),
193 migrations.CreateModel(
194 name='PackageExtractedInfo',
195 fields=[
196 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
197 ('key', models.CharField(max_length=50)),
198 ('value', jsonfield.fields.JSONField(default=dict)),
199 ],
200 options={
201 },
202 bases=(models.Model,),
203 ),
204 migrations.CreateModel(
205 name='PackageName',
206 fields=[
207 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
208 ('name', models.CharField(unique=True, max_length=100)),
209 ('source', models.BooleanField(default=False)),
210 ('binary', models.BooleanField(default=False)),
211 ('pseudo', models.BooleanField(default=False)),
212 ],
213 options={
214 },
215 bases=(models.Model,),
216 ),
217 migrations.CreateModel(
218 name='Repository',
219 fields=[
220 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
221 ('name', models.CharField(unique=True, max_length=50)),
222 ('shorthand', models.CharField(unique=True, max_length=10)),
223 ('uri', models.URLField(verbose_name='URI')),
224 ('public_uri', models.URLField(verbose_name='public URI', blank=True)),
225 ('suite', models.CharField(max_length=50)),
226 ('codename', models.CharField(max_length=50, blank=True)),
227 ('components', distro_tracker.core.utils.SpaceDelimitedTextField()),
228 ('default', models.BooleanField(default=False)),
229 ('optional', models.BooleanField(default=True)),
230 ('binary', models.BooleanField(default=True)),
231 ('source', models.BooleanField(default=True)),
232 ('position', models.IntegerField(default=0)),
233 ('architectures', models.ManyToManyField(to='core.Architecture', blank=True)),
234 ],
235 options={
236 'ordering': ('position',),
237 'verbose_name_plural': 'repositories',
238 },
239 bases=(models.Model,),
240 ),
241 migrations.CreateModel(
242 name='RepositoryFlag',
243 fields=[
244 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
245 ('name', models.CharField(max_length=50, choices=[('hidden', 'Hidden repository')])),
246 ('value', models.BooleanField(default=False)),
247 ('repository', models.ForeignKey(related_name='flags', to='core.Repository', on_delete=models.CASCADE)),
248 ],
249 options={
250 },
251 bases=(models.Model,),
252 ),
253 migrations.CreateModel(
254 name='RepositoryRelation',
255 fields=[
256 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
257 ('name', models.CharField(max_length=50, choices=[('derivative', 'Derivative repository (target=parent)'), ('overlay', 'Overlay of target repository')])),
258 ('repository', models.ForeignKey(related_name='relations', to='core.Repository', on_delete=models.CASCADE)),
259 ('target_repository', models.ForeignKey(related_name='reverse_relations', to='core.Repository', on_delete=models.CASCADE)),
260 ],
261 options={
262 },
263 bases=(models.Model,),
264 ),
265 migrations.CreateModel(
266 name='RunningJob',
267 fields=[
268 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
269 ('datetime_created', models.DateTimeField(auto_now_add=True)),
270 ('initial_task_name', models.CharField(max_length=50)),
271 ('additional_parameters', jsonfield.fields.JSONField(null=True)),
272 ('state', jsonfield.fields.JSONField(null=True)),
273 ('is_complete', models.BooleanField(default=False)),
274 ],
275 options={
276 },
277 bases=(models.Model,),
278 ),
279 migrations.CreateModel(
280 name='SourcePackage',
281 fields=[
282 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
283 ('version', models.CharField(max_length=50)),
284 ('standards_version', models.CharField(max_length=550, blank=True)),
285 ('dsc_file_name', models.CharField(max_length=255, blank=True)),
286 ('directory', models.CharField(max_length=255, blank=True)),
287 ('homepage', models.URLField(max_length=255, blank=True)),
288 ('vcs', jsonfield.fields.JSONField(default=dict)),
289 ('architectures', models.ManyToManyField(to='core.Architecture', blank=True)),
290 ('maintainer', models.ForeignKey(related_name='source_package', to='core.ContributorName', null=True, on_delete=models.CASCADE)),
291 ('uploaders', models.ManyToManyField(related_name='source_packages_uploads_set', to='core.ContributorName')),
292 ],
293 options={
294 },
295 bases=(models.Model,),
296 ),
297 migrations.CreateModel(
298 name='SourcePackageDeps',
299 fields=[
300 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
301 ('build_dep', models.BooleanField(default=False)),
302 ('binary_dep', models.BooleanField(default=False)),
303 ('details', jsonfield.fields.JSONField(default=dict)),
304 ('repository', models.ForeignKey(to='core.Repository', on_delete=models.CASCADE)),
305 ],
306 options={
307 },
308 bases=(models.Model,),
309 ),
310 migrations.CreateModel(
311 name='SourcePackageRepositoryEntry',
312 fields=[
313 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
314 ('priority', models.CharField(max_length=50, blank=True)),
315 ('section', models.CharField(max_length=50, blank=True)),
316 ('repository', models.ForeignKey(related_name='source_entries', to='core.Repository', on_delete=models.CASCADE)),
317 ('source_package', models.ForeignKey(related_name='repository_entries', to='core.SourcePackage', on_delete=models.CASCADE)),
318 ],
319 options={
320 },
321 bases=(models.Model,),
322 ),
323 migrations.CreateModel(
324 name='Subscription',
325 fields=[
326 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
327 ('active', models.BooleanField(default=True)),
328 ('_use_user_default_keywords', models.BooleanField(default=True)),
329 ('_keywords', models.ManyToManyField(to='core.Keyword')),
330 ('email_settings', models.ForeignKey(to='core.EmailSettings', on_delete=models.CASCADE)),
331 ('package', models.ForeignKey(to='core.PackageName', on_delete=models.CASCADE)),
332 ],
333 options={
334 },
335 bases=(models.Model,),
336 ),
337 migrations.CreateModel(
338 name='Team',
339 fields=[
340 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
341 ('name', models.CharField(unique=True, max_length=100)),
342 ('slug', models.SlugField(help_text='Used in the URL (/teams/<em>identifier</em>/) and in the associated email address team+<em>identifier</em>@<em>domain</em>.', unique=True, verbose_name='Identifier')),
343 ('description', models.TextField(null=True, blank=True)),
344 ('url', models.URLField(max_length=255, null=True, blank=True)),
345 ('public', models.BooleanField(default=True)),
346 ('maintainer_email', models.ForeignKey(on_delete=django.db.models.deletion.SET_NULL, blank=True, to='django_email_accounts.UserEmail', null=True)),
347 ],
348 options={
349 },
350 bases=(models.Model,),
351 ),
352 migrations.CreateModel(
353 name='TeamMembership',
354 fields=[
355 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
356 ('muted', models.BooleanField(default=False)),
357 ('has_membership_keywords', models.BooleanField(default=False)),
358 ('default_keywords', models.ManyToManyField(to='core.Keyword')),
359 ('team', models.ForeignKey(related_name='team_membership_set', to='core.Team', on_delete=models.CASCADE)),
360 ('user_email', models.ForeignKey(related_name='membership_set', to='django_email_accounts.UserEmail', on_delete=models.CASCADE)),
361 ],
362 options={
363 },
364 bases=(models.Model,),
365 ),
366 migrations.AlterUniqueTogether(
367 name='teammembership',
368 unique_together=set([('user_email', 'team')]),
369 ),
370 migrations.AddField(
371 model_name='team',
372 name='members',
373 field=models.ManyToManyField(related_name='teams', through='core.TeamMembership', to='django_email_accounts.UserEmail'),
374 preserve_default=True,
375 ),
376 migrations.AddField(
377 model_name='team',
378 name='owner',
379 field=models.ForeignKey(related_name='owned_teams', on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, null=True),
380 preserve_default=True,
381 ),
382 migrations.AddField(
383 model_name='team',
384 name='packages',
385 field=models.ManyToManyField(related_name='teams', to='core.PackageName'),
386 preserve_default=True,
387 ),
388 migrations.AlterUniqueTogether(
389 name='sourcepackagerepositoryentry',
390 unique_together=set([('source_package', 'repository')]),
391 ),
392 migrations.AlterUniqueTogether(
393 name='repositoryrelation',
394 unique_together=set([('repository', 'name')]),
395 ),
396 migrations.AlterUniqueTogether(
397 name='repositoryflag',
398 unique_together=set([('repository', 'name')]),
399 ),
400 migrations.AddField(
401 model_name='repository',
402 name='source_packages',
403 field=models.ManyToManyField(to='core.SourcePackage', through='core.SourcePackageRepositoryEntry'),
404 preserve_default=True,
405 ),
406 migrations.AddField(
407 model_name='packagename',
408 name='subscriptions',
409 field=models.ManyToManyField(to='core.EmailSettings', through='core.Subscription'),
410 preserve_default=True,
411 ),
412 migrations.AddField(
413 model_name='packageextractedinfo',
414 name='package',
415 field=models.ForeignKey(to='core.PackageName', on_delete=models.CASCADE),
416 preserve_default=True,
417 ),
418 migrations.AlterUniqueTogether(
419 name='packageextractedinfo',
420 unique_together=set([('key', 'package')]),
421 ),
422 migrations.AddField(
423 model_name='packagebugstats',
424 name='package',
425 field=models.OneToOneField(related_name='bug_stats', to='core.PackageName', on_delete=models.CASCADE),
426 preserve_default=True,
427 ),
428 migrations.AddField(
429 model_name='news',
430 name='package',
431 field=models.ForeignKey(to='core.PackageName', on_delete=models.CASCADE),
432 preserve_default=True,
433 ),
434 migrations.AddField(
435 model_name='news',
436 name='signed_by',
437 field=models.ManyToManyField(related_name='signed_news_set', to='core.ContributorName'),
438 preserve_default=True,
439 ),
440 migrations.AddField(
441 model_name='membershippackagespecifics',
442 name='membership',
443 field=models.ForeignKey(related_name='membership_package_specifics', to='core.TeamMembership', on_delete=models.CASCADE),
444 preserve_default=True,
445 ),
446 migrations.AddField(
447 model_name='membershippackagespecifics',
448 name='package_name',
449 field=models.ForeignKey(to='core.PackageName', on_delete=models.CASCADE),
450 preserve_default=True,
451 ),
452 migrations.AlterUniqueTogether(
453 name='membershippackagespecifics',
454 unique_together=set([('membership', 'package_name')]),
455 ),
456 migrations.AddField(
457 model_name='membershipconfirmation',
458 name='membership',
459 field=models.ForeignKey(to='core.TeamMembership', on_delete=models.CASCADE),
460 preserve_default=True,
461 ),
462 migrations.AddField(
463 model_name='extractedsourcefile',
464 name='source_package',
465 field=models.ForeignKey(related_name='extracted_source_files', to='core.SourcePackage', on_delete=models.CASCADE),
466 preserve_default=True,
467 ),
468 migrations.AlterUniqueTogether(
469 name='extractedsourcefile',
470 unique_together=set([('source_package', 'name')]),
471 ),
472 migrations.AddField(
473 model_name='emailsettings',
474 name='default_keywords',
475 field=models.ManyToManyField(to='core.Keyword'),
476 preserve_default=True,
477 ),
478 migrations.AddField(
479 model_name='emailsettings',
480 name='user_email',
481 field=models.OneToOneField(to='django_email_accounts.UserEmail', on_delete=models.CASCADE),
482 preserve_default=True,
483 ),
484 migrations.AlterUniqueTogether(
485 name='contributorname',
486 unique_together=set([('contributor_email', 'name')]),
487 ),
488 migrations.AddField(
489 model_name='binarypackagerepositoryentry',
490 name='repository',
491 field=models.ForeignKey(related_name='binary_entries', to='core.Repository', on_delete=models.CASCADE),
492 preserve_default=True,
493 ),
494 migrations.AlterUniqueTogether(
495 name='binarypackagerepositoryentry',
496 unique_together=set([('binary_package', 'repository', 'architecture')]),
497 ),
498 migrations.AddField(
499 model_name='binarypackage',
500 name='source_package',
501 field=models.ForeignKey(to='core.SourcePackage', on_delete=models.CASCADE),
502 preserve_default=True,
503 ),
504 migrations.AddField(
505 model_name='actionitem',
506 name='item_type',
507 field=models.ForeignKey(related_name='action_items', to='core.ActionItemType', on_delete=models.CASCADE),
508 preserve_default=True,
509 ),
510 migrations.AddField(
511 model_name='actionitem',
512 name='package',
513 field=models.ForeignKey(related_name='action_items', to='core.PackageName', on_delete=models.CASCADE),
514 preserve_default=True,
515 ),
516 migrations.AlterUniqueTogether(
517 name='actionitem',
518 unique_together=set([('package', 'item_type')]),
519 ),
520 migrations.CreateModel(
521 name='BinaryPackageName',
522 fields=[
523 ],
524 options={
525 'proxy': True,
526 },
527 bases=('core.packagename',),
528 ),
529 migrations.AddField(
530 model_name='binarypackage',
531 name='binary_package_name',
532 field=models.ForeignKey(related_name='binary_package_versions', to='core.BinaryPackageName', on_delete=models.CASCADE),
533 preserve_default=True,
534 ),
535 migrations.AlterUniqueTogether(
536 name='binarypackage',
537 unique_together=set([('binary_package_name', 'version')]),
538 ),
539 migrations.AddField(
540 model_name='binarypackagebugstats',
541 name='package',
542 field=models.OneToOneField(related_name='binary_bug_stats', to='core.BinaryPackageName', on_delete=models.CASCADE),
543 preserve_default=True,
544 ),
545 migrations.AddField(
546 model_name='sourcepackage',
547 name='binary_packages',
548 field=models.ManyToManyField(to='core.BinaryPackageName', blank=True),
549 preserve_default=True,
550 ),
551 migrations.CreateModel(
552 name='EmailNews',
553 fields=[
554 ],
555 options={
556 'proxy': True,
557 },
558 bases=('core.news',),
559 ),
560 migrations.CreateModel(
561 name='PseudoPackageName',
562 fields=[
563 ],
564 options={
565 'proxy': True,
566 },
567 bases=('core.packagename',),
568 ),
569 migrations.CreateModel(
570 name='SourcePackageName',
571 fields=[
572 ],
573 options={
574 'proxy': True,
575 },
576 bases=('core.packagename',),
577 ),
578 migrations.AddField(
579 model_name='sourcepackage',
580 name='source_package_name',
581 field=models.ForeignKey(related_name='source_package_versions', to='core.SourcePackageName', on_delete=models.CASCADE),
582 preserve_default=True,
583 ),
584 migrations.AlterUniqueTogether(
585 name='sourcepackage',
586 unique_together=set([('source_package_name', 'version')]),
587 ),
588 migrations.AddField(
589 model_name='sourcepackagedeps',
590 name='source',
591 field=models.ForeignKey(related_name='source_dependencies', to='core.SourcePackageName', on_delete=models.CASCADE),
592 preserve_default=True,
593 ),
594 migrations.AddField(
595 model_name='sourcepackagedeps',
596 name='dependency',
597 field=models.ForeignKey(related_name='source_dependents', to='core.SourcePackageName', on_delete=models.CASCADE),
598 preserve_default=True,
599 ),
600 migrations.AlterUniqueTogether(
601 name='sourcepackagedeps',
602 unique_together=set([('source', 'dependency', 'repository')]),
603 ),
604 ]