0001_initial.py 1.9 KB

1234567891011121314151617181920212223242526272829303132333435
  1. # Generated by Django 5.1.3 on 2024-11-17 20:11
  2. import django.db.models.deletion
  3. from django.db import migrations, models
  4. class Migration(migrations.Migration):
  5. initial = True
  6. dependencies = [
  7. ('files', '0009_alter_file_size'),
  8. ('organizations_ext', '0005_organization_event_throttle_rate'),
  9. ('releases', '0005_alter_releasefile_unique_together_and_more'),
  10. ]
  11. operations = [
  12. migrations.CreateModel(
  13. name='DebugSymbolBundle',
  14. fields=[
  15. ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  16. ('created', models.DateTimeField(auto_now_add=True, db_index=True)),
  17. ('debug_id', models.UUIDField(blank=True, null=True)),
  18. ('last_used', models.DateTimeField(auto_now=True, db_index=True)),
  19. ('data', models.JSONField(default=dict)),
  20. ('file', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to='files.file')),
  21. ('organization', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to='organizations_ext.organization')),
  22. ('release', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='releases.release')),
  23. ('sourcemap_file', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='files.file')),
  24. ],
  25. options={
  26. 'constraints': [models.UniqueConstraint(fields=('organization', 'debug_id'), name='unique_org_debug_id'), models.UniqueConstraint(fields=('release', 'file'), name='unique_release_file'), models.CheckConstraint(condition=models.Q(('debug_id__isnull', False), ('release__isnull', False), _connector='OR'), name='debug_id_or_release_required')],
  27. },
  28. ),
  29. ]