0001_initial.py 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. # Generated by Django 3.1.4 on 2020-12-18 21:28
  2. from django.conf import settings
  3. from django.db import migrations, models
  4. import django.db.models.deletion
  5. class Migration(migrations.Migration):
  6. initial = True
  7. dependencies = [
  8. (
  9. "projects",
  10. "0001_squashed_0009_alter_project_id_alter_projectcounter_id_and_more",
  11. ),
  12. ("organizations_ext", "0001_squashed_0009_organization_scrub_ip_addresses"),
  13. migrations.swappable_dependency(settings.AUTH_USER_MODEL),
  14. ]
  15. operations = [
  16. migrations.CreateModel(
  17. name="Release",
  18. fields=[
  19. (
  20. "id",
  21. models.AutoField(
  22. auto_created=True,
  23. primary_key=True,
  24. serialize=False,
  25. verbose_name="ID",
  26. ),
  27. ),
  28. ("version", models.CharField(max_length=255)),
  29. (
  30. "ref",
  31. models.CharField(
  32. blank=True,
  33. help_text="May be branch or tag name",
  34. max_length=255,
  35. null=True,
  36. ),
  37. ),
  38. ("url", models.URLField(blank=True, null=True)),
  39. ("created", models.DateTimeField(auto_now_add=True, db_index=True)),
  40. ("released", models.DateTimeField(blank=True, null=True)),
  41. ("data", models.JSONField()),
  42. ("commit_count", models.PositiveSmallIntegerField(default=0)),
  43. ("deploy_count", models.PositiveSmallIntegerField(default=0)),
  44. (
  45. "organization",
  46. models.ForeignKey(
  47. on_delete=django.db.models.deletion.CASCADE,
  48. to="organizations_ext.organization",
  49. ),
  50. ),
  51. (
  52. "owner",
  53. models.ForeignKey(
  54. blank=True,
  55. help_text="Release manager - the person initiating the release",
  56. null=True,
  57. on_delete=django.db.models.deletion.SET_NULL,
  58. to=settings.AUTH_USER_MODEL,
  59. ),
  60. ),
  61. (
  62. "projects",
  63. models.ManyToManyField(
  64. related_name="releases", to="projects.Project"
  65. ),
  66. ),
  67. ],
  68. options={
  69. "unique_together": {("organization", "version")},
  70. },
  71. ),
  72. migrations.CreateModel(
  73. name="ReleaseProject",
  74. fields=[
  75. (
  76. "id",
  77. models.AutoField(
  78. auto_created=True,
  79. primary_key=True,
  80. serialize=False,
  81. verbose_name="ID",
  82. ),
  83. ),
  84. (
  85. "project",
  86. models.ForeignKey(
  87. on_delete=django.db.models.deletion.CASCADE,
  88. to="projects.project",
  89. ),
  90. ),
  91. (
  92. "release",
  93. models.ForeignKey(
  94. on_delete=django.db.models.deletion.CASCADE,
  95. to="releases.release",
  96. ),
  97. ),
  98. ],
  99. options={
  100. "unique_together": {("project", "release")},
  101. },
  102. ),
  103. ]