0001_initial.py 1.3 KB

123456789101112131415161718192021222324252627282930
  1. # Generated by Django 3.1 on 2020-08-16 15:56
  2. import api_tokens.models
  3. import bitfield.models
  4. from django.conf import settings
  5. from django.db import migrations, models
  6. import django.db.models.deletion
  7. class Migration(migrations.Migration):
  8. initial = True
  9. dependencies = [
  10. migrations.swappable_dependency(settings.AUTH_USER_MODEL),
  11. ]
  12. operations = [
  13. migrations.CreateModel(
  14. name='APIToken',
  15. fields=[
  16. ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  17. ('token', models.CharField(default=api_tokens.models.generate_token, max_length=40, unique=True)),
  18. ('label', models.CharField(blank=True, max_length=255)),
  19. ('scopes', bitfield.models.BitField(('project:read', 'project:write', 'project:admin', 'project:releases', 'team:read', 'team:write', 'team:admin', 'event:read', 'event:write', 'event:admin', 'org:read', 'org:write', 'org:admin', 'member:read', 'member:write', 'member:admin'), default=None)),
  20. ('created', models.DateTimeField(auto_now_add=True)),
  21. ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
  22. ],
  23. ),
  24. ]