0001_initial.py 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. # Generated by Django 3.0.3 on 2020-02-28 17:52
  2. import django.contrib.postgres.fields.jsonb
  3. from django.db import migrations, models
  4. import django.db.models.deletion
  5. import django_extensions.db.fields
  6. import uuid
  7. class Migration(migrations.Migration):
  8. initial = True
  9. dependencies = [
  10. ('organizations_ext', '0001_initial'),
  11. ]
  12. operations = [
  13. migrations.CreateModel(
  14. name='Project',
  15. fields=[
  16. ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  17. ('slug', django_extensions.db.fields.AutoSlugField(blank=True, editable=False, populate_from=['name', 'organization_id'])),
  18. ('name', models.CharField(max_length=200)),
  19. ('created', models.DateTimeField(auto_now_add=True, db_index=True)),
  20. ('platform', models.CharField(blank=True, max_length=64, null=True)),
  21. ('organization', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='projects', to='organizations_ext.Organization')),
  22. ],
  23. options={
  24. 'unique_together': {('organization', 'slug')},
  25. },
  26. ),
  27. migrations.CreateModel(
  28. name='ProjectKey',
  29. fields=[
  30. ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  31. ('label', models.CharField(blank=True, max_length=64)),
  32. ('public_key', models.UUIDField(default=uuid.uuid4, editable=False, unique=True)),
  33. ('created', models.DateTimeField(auto_now_add=True)),
  34. ('rate_limit_count', models.PositiveSmallIntegerField(blank=True, null=True)),
  35. ('rate_limit_window', models.PositiveSmallIntegerField(blank=True, null=True)),
  36. ('data', django.contrib.postgres.fields.jsonb.JSONField(blank=True, null=True)),
  37. ('project', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='projects.Project')),
  38. ],
  39. ),
  40. ]