0001_initial.py 3.7 KB

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