0001_initial.py 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. ('projects', '0007_auto_20201026_2354'),
  9. ('organizations_ext', '0009_organization_scrub_ip_addresses'),
  10. migrations.swappable_dependency(settings.AUTH_USER_MODEL),
  11. ]
  12. operations = [
  13. migrations.CreateModel(
  14. name='Release',
  15. fields=[
  16. ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  17. ('version', models.CharField(max_length=255)),
  18. ('ref', models.CharField(blank=True, help_text='May be branch or tag name', max_length=255, null=True)),
  19. ('url', models.URLField(blank=True, null=True)),
  20. ('created', models.DateTimeField(auto_now_add=True, db_index=True)),
  21. ('released', models.DateTimeField(blank=True, null=True)),
  22. ('data', models.JSONField()),
  23. ('commit_count', models.PositiveSmallIntegerField(default=0)),
  24. ('deploy_count', models.PositiveSmallIntegerField(default=0)),
  25. ('organization', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='organizations_ext.organization')),
  26. ('owner', models.ForeignKey(blank=True, help_text='Release manager - the person initiating the release', null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
  27. ('projects', models.ManyToManyField(related_name='releases', to='projects.Project')),
  28. ],
  29. options={
  30. 'unique_together': {('organization', 'version')},
  31. },
  32. ),
  33. migrations.CreateModel(
  34. name='ReleaseProject',
  35. fields=[
  36. ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  37. ('project', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='projects.project')),
  38. ('release', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='releases.release')),
  39. ],
  40. options={
  41. 'unique_together': {('project', 'release')},
  42. },
  43. ),
  44. ]