0001_initial.py 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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', '0009_organization_scrub_ip_addresses'),
  9. ]
  10. operations = [
  11. migrations.CreateModel(
  12. name='Environment',
  13. fields=[
  14. ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  15. ('name', models.CharField(max_length=256)),
  16. ('created', models.DateTimeField(auto_now_add=True, db_index=True)),
  17. ('organization', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='organizations_ext.organization')),
  18. ],
  19. ),
  20. migrations.CreateModel(
  21. name='EnvironmentProject',
  22. fields=[
  23. ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  24. ('is_hidden', models.BooleanField()),
  25. ('created', models.DateTimeField(auto_now_add=True, db_index=True)),
  26. ('environment', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='environments.environment')),
  27. ('project', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='projects.project')),
  28. ],
  29. options={
  30. 'unique_together': {('project', 'environment')},
  31. },
  32. ),
  33. migrations.AddField(
  34. model_name='environment',
  35. name='projects',
  36. field=models.ManyToManyField(through='environments.EnvironmentProject', to='projects.Project'),
  37. ),
  38. migrations.AlterUniqueTogether(
  39. name='environment',
  40. unique_together={('organization', 'name')},
  41. ),
  42. ]