|
| 1 | +# Generated by Django 4.0.6 on 2023-08-21 07:45 |
| 2 | + |
| 3 | +from django.conf import settings |
| 4 | +import django.contrib.postgres.fields |
| 5 | +from django.db import migrations, models |
| 6 | +import django.db.models.deletion |
| 7 | +import user.models |
| 8 | +import uuid |
| 9 | + |
| 10 | + |
| 11 | +class Migration(migrations.Migration): |
| 12 | + |
| 13 | + initial = True |
| 14 | + |
| 15 | + dependencies = [ |
| 16 | + ('auth', '0012_alter_user_first_name_max_length'), |
| 17 | + ] |
| 18 | + |
| 19 | + operations = [ |
| 20 | + migrations.CreateModel( |
| 21 | + name='User', |
| 22 | + fields=[ |
| 23 | + ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')), |
| 24 | + ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), |
| 25 | + ('email', models.EmailField(blank=True, max_length=254, null=True, unique=True, verbose_name='email address')), |
| 26 | + ('password', models.CharField(max_length=255, null=True)), |
| 27 | + ('firstname', models.CharField(blank=True, max_length=255, null=True)), |
| 28 | + ('lastname', models.CharField(blank=True, max_length=255, null=True)), |
| 29 | + ('image', models.FileField(blank=True, null=True, upload_to='users/')), |
| 30 | + ('phone', models.CharField(blank=True, max_length=30, null=True, unique=True)), |
| 31 | + ('is_locked', models.BooleanField(default=False)), |
| 32 | + ('is_staff', models.BooleanField(default=False)), |
| 33 | + ('is_active', models.BooleanField(default=False)), |
| 34 | + ('is_admin', models.BooleanField(default=False)), |
| 35 | + ('last_login', models.DateTimeField(blank=True, null=True)), |
| 36 | + ('created_at', models.DateTimeField(auto_now_add=True)), |
| 37 | + ('updated_at', models.DateTimeField(auto_now=True)), |
| 38 | + ('verified', models.BooleanField(default=False)), |
| 39 | + ('roles', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(blank=True, choices=[('ADMIN', 'ADMIN'), ('CUSTOMER', 'CUSTOMER')], max_length=20), default=user.models.default_role, size=6)), |
| 40 | + ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.group', verbose_name='groups')), |
| 41 | + ('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.permission', verbose_name='user permissions')), |
| 42 | + ], |
| 43 | + options={ |
| 44 | + 'ordering': ('-created_at',), |
| 45 | + }, |
| 46 | + ), |
| 47 | + migrations.CreateModel( |
| 48 | + name='PendingUser', |
| 49 | + fields=[ |
| 50 | + ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), |
| 51 | + ('created_at', models.DateTimeField(auto_now_add=True)), |
| 52 | + ('updated_at', models.DateTimeField(auto_now=True)), |
| 53 | + ('phone', models.CharField(max_length=20)), |
| 54 | + ('verification_code', models.CharField(blank=True, max_length=8, null=True)), |
| 55 | + ('password', models.CharField(max_length=255, null=True)), |
| 56 | + ], |
| 57 | + options={ |
| 58 | + 'abstract': False, |
| 59 | + }, |
| 60 | + ), |
| 61 | + migrations.CreateModel( |
| 62 | + name='Token', |
| 63 | + fields=[ |
| 64 | + ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), |
| 65 | + ('token', models.CharField(max_length=8)), |
| 66 | + ('token_type', models.CharField(choices=[('PASSWORD_RESET', 'PASSWORD_RESET')], max_length=100)), |
| 67 | + ('created_at', models.DateTimeField(auto_now_add=True)), |
| 68 | + ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), |
| 69 | + ], |
| 70 | + ), |
| 71 | + ] |
0 commit comments