0001_initial.py 2.7 KB

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