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.

71 lines
2.7 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  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. (
  18. "id",
  19. models.BigAutoField(
  20. auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
  21. ),
  22. ),
  23. ("name", models.CharField(max_length=100, unique=True)),
  24. ("description", models.TextField(default="")),
  25. ("created_at", models.DateTimeField(auto_now_add=True)),
  26. ("updated_at", models.DateTimeField(auto_now=True)),
  27. ],
  28. ),
  29. migrations.CreateModel(
  30. name="RoleMapping",
  31. fields=[
  32. (
  33. "id",
  34. models.BigAutoField(
  35. auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
  36. ),
  37. ),
  38. ("created_at", models.DateTimeField(auto_now_add=True)),
  39. ("updated_at", models.DateTimeField(auto_now=True)),
  40. (
  41. "project",
  42. models.ForeignKey(
  43. on_delete=django.db.models.deletion.CASCADE,
  44. related_name="role_mappings",
  45. to="api.project",
  46. ),
  47. ),
  48. ("role", models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to="roles.role")),
  49. (
  50. "user",
  51. models.ForeignKey(
  52. on_delete=django.db.models.deletion.CASCADE,
  53. related_name="role_mappings",
  54. to=settings.AUTH_USER_MODEL,
  55. ),
  56. ),
  57. ],
  58. options={
  59. "unique_together": {("user", "project")},
  60. },
  61. ),
  62. ],
  63. database_operations=[],
  64. )
  65. ]