You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
2.2 KiB

  1. # Generated by Django 3.2.8 on 2022-01-11 06:55
  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. migrations.swappable_dependency(settings.AUTH_USER_MODEL),
  9. ('api', '0028_auto_20220111_0655'),
  10. ]
  11. operations = [
  12. migrations.SeparateDatabaseAndState(
  13. state_operations=[
  14. migrations.CreateModel(
  15. name='Role',
  16. fields=[
  17. ('id',
  18. models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  19. ('name', models.CharField(max_length=100, unique=True)),
  20. ('description', models.TextField(default='')),
  21. ('created_at', models.DateTimeField(auto_now_add=True)),
  22. ('updated_at', models.DateTimeField(auto_now=True)),
  23. ],
  24. ),
  25. migrations.CreateModel(
  26. name='RoleMapping',
  27. fields=[
  28. ('id',
  29. models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  30. ('created_at', models.DateTimeField(auto_now_add=True)),
  31. ('updated_at', models.DateTimeField(auto_now=True)),
  32. ('project',
  33. models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='role_mappings',
  34. to='api.project')),
  35. ('role', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='roles.role')),
  36. ('user',
  37. models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='role_mappings',
  38. to=settings.AUTH_USER_MODEL)),
  39. ],
  40. options={
  41. 'unique_together': {('user', 'project')},
  42. },
  43. ),
  44. ],
  45. database_operations=[]
  46. )
  47. ]