Coverage for django_napse/auth/migrations/0001_initial.py: 100%

7 statements  

« prev     ^ index     » next       coverage.py v7.4.3, created at 2024-03-12 13:49 +0000

1# Generated by Django 4.2.5 on 2023-10-09 15:35 

2 

3from django.db import migrations, models 

4import django.db.models.deletion 

5import uuid 

6 

7 

8class Migration(migrations.Migration): 

9 

10 initial = True 

11 

12 dependencies = [ 

13 ("django_napse_core", "0001_initial"), 

14 ("rest_framework_api_key", "0005_auto_20220110_1102"), 

15 ] 

16 

17 operations = [ 

18 migrations.CreateModel( 

19 name="KeyPermission", 

20 fields=[ 

21 ( 

22 "id", 

23 models.BigAutoField( 

24 auto_created=True, 

25 primary_key=True, 

26 serialize=False, 

27 verbose_name="ID", 

28 ), 

29 ), 

30 ( 

31 "uuid", 

32 models.UUIDField(default=uuid.uuid4, editable=False, unique=True), 

33 ), 

34 ("approved", models.BooleanField(default=False)), 

35 ("revoked", models.BooleanField(default=False)), 

36 ("permission_type", models.CharField(max_length=200)), 

37 ( 

38 "key", 

39 models.ForeignKey( 

40 on_delete=django.db.models.deletion.CASCADE, 

41 related_name="permissions", 

42 to="rest_framework_api_key.apikey", 

43 ), 

44 ), 

45 ( 

46 "space", 

47 models.ForeignKey( 

48 on_delete=django.db.models.deletion.CASCADE, 

49 to="django_napse_core.napsespace", 

50 ), 

51 ), 

52 ], 

53 options={ 

54 "unique_together": {("key", "space", "permission_type")}, 

55 }, 

56 ), 

57 ]