0003_auto_20210509_1658.py 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. # Generated by Django 3.2.1 on 2021-05-09 16:58
  2. from django.db import migrations, models
  3. import django.db.models.deletion
  4. class Migration(migrations.Migration):
  5. dependencies = [
  6. ("files", "0004_auto_20210509_1658"),
  7. ("releases", "0002_auto_20201227_1518"),
  8. ]
  9. operations = [
  10. migrations.CreateModel(
  11. name="ReleaseFile",
  12. fields=[
  13. (
  14. "id",
  15. models.AutoField(
  16. auto_created=True,
  17. primary_key=True,
  18. serialize=False,
  19. verbose_name="ID",
  20. ),
  21. ),
  22. ("created", models.DateTimeField(auto_now_add=True, db_index=True)),
  23. ("ident", models.CharField(max_length=40)),
  24. ("name", models.TextField()),
  25. (
  26. "file",
  27. models.ForeignKey(
  28. on_delete=django.db.models.deletion.CASCADE, to="files.file"
  29. ),
  30. ),
  31. (
  32. "release",
  33. models.ForeignKey(
  34. on_delete=django.db.models.deletion.CASCADE,
  35. to="releases.release",
  36. ),
  37. ),
  38. ],
  39. options={
  40. "unique_together": {("release", "file"), ("release", "ident")},
  41. },
  42. ),
  43. migrations.AddField(
  44. model_name="release",
  45. name="files",
  46. field=models.ManyToManyField(
  47. through="releases.ReleaseFile", to="files.File"
  48. ),
  49. ),
  50. ]