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.

69 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
2 years ago
  1. # Generated by Django 3.2.8 on 2022-01-13 01:54
  2. import django.db.models.deletion
  3. from django.conf import settings
  4. from django.db import migrations, models
  5. class Migration(migrations.Migration):
  6. initial = True
  7. dependencies = [
  8. migrations.swappable_dependency(settings.AUTH_USER_MODEL),
  9. ("roles", "0003_delete_member"),
  10. ("api", "0028_auto_20220111_0655"),
  11. ]
  12. operations = [
  13. migrations.SeparateDatabaseAndState(
  14. state_operations=[
  15. migrations.CreateModel(
  16. name="Member",
  17. fields=[
  18. (
  19. "id",
  20. models.BigAutoField(
  21. auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
  22. ),
  23. ),
  24. ("created_at", models.DateTimeField(auto_now_add=True)),
  25. ("updated_at", models.DateTimeField(auto_now=True)),
  26. (
  27. "project",
  28. models.ForeignKey(
  29. on_delete=django.db.models.deletion.CASCADE,
  30. related_name="role_mappings",
  31. to="api.project",
  32. ),
  33. ),
  34. ("role", models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to="roles.role")),
  35. (
  36. "user",
  37. models.ForeignKey(
  38. on_delete=django.db.models.deletion.CASCADE,
  39. related_name="role_mappings",
  40. to=settings.AUTH_USER_MODEL,
  41. ),
  42. ),
  43. ],
  44. options={
  45. "unique_together": {("user", "project")},
  46. },
  47. ),
  48. ],
  49. database_operations=[],
  50. ),
  51. migrations.RunSQL(
  52. sql="ALTER TABLE members_member RENAME TO projects_member",
  53. reverse_sql="ALTER TABLE projects_member RENAME TO members_member",
  54. ),
  55. migrations.RunSQL(
  56. sql="UPDATE django_content_type SET app_label='projects' WHERE app_label='members'",
  57. reverse_sql="UPDATE django_content_type SET app_label='members' WHERE app_label='projects'",
  58. ),
  59. migrations.RunSQL(
  60. sql="UPDATE django_migrations SET app='projects' WHERE app='members'",
  61. reverse_sql="UPDATE django_migrations SET app='members' WHERE app='projects'",
  62. ),
  63. ]