0001_initial.py 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. # Generated by Django 3.1.3 on 2020-11-15 21:19
  2. from django.db import migrations, models
  3. import django.db.models.deletion
  4. class Migration(migrations.Migration):
  5. initial = True
  6. dependencies = [
  7. ("projects", "0007_auto_20201026_2354"),
  8. ("organizations_ext", "0001_squashed_0009_organization_scrub_ip_addresses"),
  9. ]
  10. operations = [
  11. migrations.CreateModel(
  12. name="Environment",
  13. fields=[
  14. (
  15. "id",
  16. models.AutoField(
  17. auto_created=True,
  18. primary_key=True,
  19. serialize=False,
  20. verbose_name="ID",
  21. ),
  22. ),
  23. ("name", models.CharField(max_length=256)),
  24. ("created", models.DateTimeField(auto_now_add=True, db_index=True)),
  25. (
  26. "organization",
  27. models.ForeignKey(
  28. on_delete=django.db.models.deletion.CASCADE,
  29. to="organizations_ext.organization",
  30. ),
  31. ),
  32. ],
  33. ),
  34. migrations.CreateModel(
  35. name="EnvironmentProject",
  36. fields=[
  37. (
  38. "id",
  39. models.AutoField(
  40. auto_created=True,
  41. primary_key=True,
  42. serialize=False,
  43. verbose_name="ID",
  44. ),
  45. ),
  46. ("is_hidden", models.BooleanField()),
  47. ("created", models.DateTimeField(auto_now_add=True, db_index=True)),
  48. (
  49. "environment",
  50. models.ForeignKey(
  51. on_delete=django.db.models.deletion.CASCADE,
  52. to="environments.environment",
  53. ),
  54. ),
  55. (
  56. "project",
  57. models.ForeignKey(
  58. on_delete=django.db.models.deletion.CASCADE,
  59. to="projects.project",
  60. ),
  61. ),
  62. ],
  63. options={
  64. "unique_together": {("project", "environment")},
  65. },
  66. ),
  67. migrations.AddField(
  68. model_name="environment",
  69. name="projects",
  70. field=models.ManyToManyField(
  71. through="environments.EnvironmentProject", to="projects.Project"
  72. ),
  73. ),
  74. migrations.AlterUniqueTogether(
  75. name="environment",
  76. unique_together={("organization", "name")},
  77. ),
  78. ]