1- # Generated by Django 4.1.5 on 2023-01-16 09 :13
1+ # Generated by Django 4.1.5 on 2023-01-22 18 :13
22
33import django .contrib .auth .models
44from django .db import migrations , models
@@ -16,8 +16,23 @@ class Migration(migrations.Migration):
1616
1717 operations = [
1818 migrations .CreateModel (
19- name = "OTPValidation " ,
19+ name = "User " ,
2020 fields = [
21+ ("password" , models .CharField (max_length = 128 , verbose_name = "password" )),
22+ (
23+ "last_login" ,
24+ models .DateTimeField (
25+ blank = True , null = True , verbose_name = "last login"
26+ ),
27+ ),
28+ (
29+ "is_superuser" ,
30+ models .BooleanField (
31+ default = False ,
32+ help_text = "Designates that this user has all permissions without explicitly assigning them." ,
33+ verbose_name = "superuser status" ,
34+ ),
35+ ),
2136 (
2237 "id" ,
2338 models .UUIDField (
@@ -30,57 +45,28 @@ class Migration(migrations.Migration):
3045 ("created_at" , models .DateTimeField (auto_now_add = True , db_index = True )),
3146 ("modified_at" , models .DateTimeField (auto_now = True )),
3247 (
33- "otp" ,
34- models .CharField (blank = True , max_length = 6 , null = True , verbose_name = "OTP" ),
35- ),
36- (
37- "valid_until" ,
38- models .DateTimeField (
39- default = django .utils .timezone .now ,
40- help_text = "The timestamp of the moment of expiry of the saved token." ,
41- ),
42- ),
43- (
44- "destination" ,
48+ "username" ,
4549 models .CharField (
46- db_index = True ,
47- max_length = 10 ,
48- unique = True ,
49- verbose_name = "OTP Generated For" ,
50+ max_length = 10 , unique = True , verbose_name = "Mobile Number"
5051 ),
5152 ),
52- ("is_validated" , models .BooleanField (default = False )),
53- (
54- "validate_attempt" ,
55- models .IntegerField (default = 3 , verbose_name = "Attempted Validation" ),
56- ),
57- (
58- "otp_reactive_at" ,
59- models .DateTimeField (blank = True , null = True , verbose_name = "OTP Reactive At" ),
60- ),
61- ("extra_data" , models .JSONField (blank = True , null = True )),
53+ ("email" , models .EmailField (blank = True , max_length = 255 , null = True )),
54+ ("name" , models .CharField (blank = True , max_length = 255 , null = True )),
55+ ("is_active" , models .BooleanField (default = True )),
56+ ("is_staff" , models .BooleanField (default = False )),
6257 ],
6358 options = {
64- "ordering" : ["-created_at" ],
65- "abstract" : False ,
59+ "verbose_name" : "User" ,
60+ "verbose_name_plural" : "Users" ,
61+ "ordering" : ("-created_at" ,),
6662 },
63+ managers = [
64+ ("objects" , django .contrib .auth .models .UserManager ()),
65+ ],
6766 ),
6867 migrations .CreateModel (
69- name = "User " ,
68+ name = "OTPValidation " ,
7069 fields = [
71- ("password" , models .CharField (max_length = 128 , verbose_name = "password" )),
72- (
73- "last_login" ,
74- models .DateTimeField (blank = True , null = True , verbose_name = "last login" ),
75- ),
76- (
77- "is_superuser" ,
78- models .BooleanField (
79- default = False ,
80- help_text = "Designates that this user has all permissions without explicitly assigning them." ,
81- verbose_name = "superuser status" ,
82- ),
83- ),
8470 (
8571 "id" ,
8672 models .UUIDField (
@@ -93,42 +79,77 @@ class Migration(migrations.Migration):
9379 ("created_at" , models .DateTimeField (auto_now_add = True , db_index = True )),
9480 ("modified_at" , models .DateTimeField (auto_now = True )),
9581 (
96- "username" ,
97- models .CharField (max_length = 10 , unique = True , verbose_name = "Mobile Number" ),
82+ "otp" ,
83+ models .CharField (
84+ blank = True , max_length = 6 , null = True , verbose_name = "OTP"
85+ ),
86+ ),
87+ (
88+ "valid_until" ,
89+ models .DateTimeField (
90+ default = django .utils .timezone .now ,
91+ help_text = "The timestamp of the moment of expiry of the saved token." ,
92+ ),
9893 ),
99- ("email" , models .EmailField (blank = True , max_length = 255 , null = True )),
100- ("name" , models .CharField (blank = True , max_length = 255 , null = True )),
101- ("is_active" , models .BooleanField (default = True )),
102- ("is_staff" , models .BooleanField (default = False )),
10394 (
104- "groups" ,
105- models .ManyToManyField (
106- blank = True ,
107- help_text = "The groups this user belongs to. A user will get all permissions granted to each of their groups." ,
108- related_name = "user_set" ,
109- related_query_name = "user" ,
110- to = "auth.group" ,
111- verbose_name = "groups" ,
95+ "destination" ,
96+ models .CharField (
97+ max_length = 10 , unique = True , verbose_name = "OTP Generated For"
11298 ),
11399 ),
100+ ("is_validated" , models .BooleanField (default = False )),
101+ (
102+ "validate_attempt" ,
103+ models .IntegerField (default = 3 , verbose_name = "Attempted Validation" ),
104+ ),
114105 (
115- "user_permissions" ,
116- models .ManyToManyField (
117- blank = True ,
118- help_text = "Specific permissions for this user." ,
119- related_name = "user_set" ,
120- related_query_name = "user" ,
121- to = "auth.permission" ,
122- verbose_name = "user permissions" ,
106+ "otp_reactive_at" ,
107+ models .DateTimeField (
108+ blank = True , null = True , verbose_name = "OTP Reactive At"
123109 ),
124110 ),
111+ ("extra_data" , models .JSONField (blank = True , null = True )),
125112 ],
126113 options = {
127- "verbose_name" : "User" ,
128- "verbose_name_plural" : "Users" ,
114+ "verbose_name" : "OTP Validation" ,
115+ "verbose_name_plural" : "OTP Validations" ,
116+ "ordering" : ["-created_at" ],
129117 },
130- managers = [
131- ("objects" , django .contrib .auth .models .UserManager ()),
132- ],
118+ ),
119+ migrations .AddIndex (
120+ model_name = "otpvalidation" ,
121+ index = models .Index (
122+ fields = ["destination" ], name = "accounts_ot_destina_e42df1_idx"
123+ ),
124+ ),
125+ migrations .AddField (
126+ model_name = "user" ,
127+ name = "groups" ,
128+ field = models .ManyToManyField (
129+ blank = True ,
130+ help_text = "The groups this user belongs to. A user will get all permissions granted to each of their groups." ,
131+ related_name = "user_set" ,
132+ related_query_name = "user" ,
133+ to = "auth.group" ,
134+ verbose_name = "groups" ,
135+ ),
136+ ),
137+ migrations .AddField (
138+ model_name = "user" ,
139+ name = "user_permissions" ,
140+ field = models .ManyToManyField (
141+ blank = True ,
142+ help_text = "Specific permissions for this user." ,
143+ related_name = "user_set" ,
144+ related_query_name = "user" ,
145+ to = "auth.permission" ,
146+ verbose_name = "user permissions" ,
147+ ),
148+ ),
149+ migrations .AddIndex (
150+ model_name = "user" ,
151+ index = models .Index (
152+ fields = ["username" ], name = "accounts_us_usernam_c0ea66_idx"
153+ ),
133154 ),
134155 ]
0 commit comments