Coverage for expo_notifications/migrations/0001_initial.py: 0%

1# Generated by Django 5.1.7 on 2025-03-22 18:31

2

3 import django.db.models.deletion

4 import django.utils.timezone

5 from django.conf import settings

6 from django.db import migrations, models

7

8

9 class Migration(migrations.Migration):

10 initial = True

11

12 dependencies = [

13 migrations.swappable_dependency(settings.AUTH_USER_MODEL),

14 ]

15

16 operations = [

17 migrations.CreateModel(

18 name="Device",

19 fields=[

20 (

21 "id",

22 models.BigAutoField(

23 auto_created=True,

24 primary_key=True,

25 serialize=False,

26 verbose_name="ID",

27 ),

28 ),

29 ("lang", models.CharField(blank=True, max_length=5)),

30 ("push_token", models.CharField(max_length=4096)),

31 (

32 "date_registered",

33 models.DateTimeField(default=django.utils.timezone.now),

34 ),

35 ("is_active", models.BooleanField(default=True)),

36 (

37 "user",

38 models.ForeignKey(

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

40 related_name="devices",

41 to=settings.AUTH_USER_MODEL,

42 ),

43 ),

44 ],

45 options={

46 "unique_together": {("user", "push_token")},

47 },

48 ),

49 migrations.CreateModel(

50 name="Message",

51 fields=[

52 (

53 "id",

54 models.BigAutoField(

55 auto_created=True,

56 primary_key=True,

57 serialize=False,

58 verbose_name="ID",

59 ),

60 ),

61 ("data", models.JSONField(blank=True, null=True)),

62 ("title", models.CharField(blank=True, max_length=64)),

63 ("body", models.CharField(blank=True, max_length=256)),

64 ("ttl", models.DurationField(blank=True, null=True)),

65 ("expiration", models.DateTimeField(blank=True, null=True)),

66 (

67 "priority",

68 models.CharField(

69 blank=True,

70 choices=[

71 ("default", "Default"),

72 ("normal", "Normal"),

73 ("high", "High"),

74 ],

75 max_length=7,

76 null=True,

77 ),

78 ),

79 ("subtitle", models.CharField(blank=True, max_length=64)),

80 ("sound", models.CharField(blank=True, max_length=64)),

81 ("badge", models.PositiveSmallIntegerField(blank=True, null=True)),

82 ("channel_id", models.CharField(blank=True, max_length=32)),

83 ("category_id", models.CharField(blank=True, max_length=64)),

84 ("mutable_content", models.BooleanField(default=False)),

85 (

86 "date_created",

87 models.DateTimeField(default=django.utils.timezone.now),

88 ),

89 (

90 "device",

91 models.ForeignKey(

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

93 related_name="messages",

94 to="expo_notifications.device",

95 ),

96 ),

97 ],

98 ),

99 migrations.CreateModel(

100 name="Ticket",

101 fields=[

102 (

103 "id",

104 models.BigAutoField(

105 auto_created=True,

106 primary_key=True,

107 serialize=False,

108 verbose_name="ID",

109 ),

110 ),

111 ("is_success", models.BooleanField()),

112 ("external_id", models.CharField(blank=True, max_length=64)),

113 ("error_message", models.TextField(blank=True)),

114 ("date_received", models.DateTimeField()),

115 (

116 "message",

117 models.ForeignKey(

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

119 related_name="tickets",

120 to="expo_notifications.message",

121 ),

122 ),

123 ],

124 ),

125 migrations.CreateModel(

126 name="Receipt",

127 fields=[

128 (

129 "id",

130 models.BigAutoField(

131 auto_created=True,

132 primary_key=True,

133 serialize=False,

134 verbose_name="ID",

135 ),

136 ),

137 ("is_success", models.BooleanField()),

138 ("error_message", models.TextField(blank=True)),

139 ("date_checked", models.DateTimeField()),

140 (

141 "ticket",

142 models.ForeignKey(

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

144 related_name="receipts",

145 to="expo_notifications.ticket",

146 ),

147 ),

148 ],

149 ),

150 ]