|
| 1 | +# Generated by Django 4.2.3 on 2023-07-28 06:53 |
| 2 | + |
| 3 | +import django.contrib.auth.models |
| 4 | +import django.contrib.auth.validators |
| 5 | +import django.utils.timezone |
| 6 | +from django.conf import settings |
| 7 | +from django.db import migrations, models |
| 8 | + |
| 9 | + |
| 10 | +class Migration(migrations.Migration): |
| 11 | + initial = True |
| 12 | + |
| 13 | + dependencies = [ |
| 14 | + ('auth', '0012_alter_user_first_name_max_length'), |
| 15 | + ] |
| 16 | + |
| 17 | + operations = [ |
| 18 | + migrations.CreateModel( |
| 19 | + name='User', |
| 20 | + fields=[ |
| 21 | + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
| 22 | + ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')), |
| 23 | + ('is_superuser', models.BooleanField(default=False, |
| 24 | + help_text='Designates that this user has all permissions without explicitly assigning them.', |
| 25 | + verbose_name='superuser status')), |
| 26 | + ('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, |
| 27 | + help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', |
| 28 | + max_length=150, unique=True, |
| 29 | + validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], |
| 30 | + verbose_name='username')), |
| 31 | + ('first_name', models.CharField(blank=True, max_length=150, verbose_name='first name')), |
| 32 | + ('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')), |
| 33 | + ('email', models.EmailField(blank=True, max_length=254, verbose_name='email address')), |
| 34 | + ('is_staff', models.BooleanField(default=False, |
| 35 | + help_text='Designates whether the user can log into this admin site.', |
| 36 | + verbose_name='staff status')), |
| 37 | + ('is_active', models.BooleanField(default=True, |
| 38 | + help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', |
| 39 | + verbose_name='active')), |
| 40 | + ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')), |
| 41 | + ('role', models.CharField(choices=[('patient', 'Patient'), ('doctor', 'Doctor')], max_length=10)), |
| 42 | + ('password', models.CharField(max_length=255)), |
| 43 | + ], |
| 44 | + options={ |
| 45 | + 'verbose_name': 'user', |
| 46 | + 'verbose_name_plural': 'users', |
| 47 | + 'abstract': False, |
| 48 | + }, |
| 49 | + managers=[ |
| 50 | + ('objects', django.contrib.auth.models.UserManager()), |
| 51 | + ], |
| 52 | + ), |
| 53 | + migrations.CreateModel( |
| 54 | + name='Department', |
| 55 | + fields=[ |
| 56 | + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
| 57 | + ('name', models.CharField(max_length=50)), |
| 58 | + ('diagnostics', models.CharField(max_length=100)), |
| 59 | + ('location', models.CharField(max_length=100)), |
| 60 | + ('specialization', models.CharField(max_length=20)), |
| 61 | + ], |
| 62 | + ), |
| 63 | + migrations.CreateModel( |
| 64 | + name='PatientReport', |
| 65 | + fields=[ |
| 66 | + ('record_id', models.BigAutoField(primary_key=True, serialize=False)), |
| 67 | + ('created', models.DateTimeField(auto_now_add=True)), |
| 68 | + ('diagnostics', models.TextField()), |
| 69 | + ('observations', models.TextField()), |
| 70 | + ('treatments', models.TextField()), |
| 71 | + ('department', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.department')), |
| 72 | + ( |
| 73 | + 'patient', |
| 74 | + models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), |
| 75 | + ], |
| 76 | + ), |
| 77 | + migrations.AddField( |
| 78 | + model_name='user', |
| 79 | + name='department', |
| 80 | + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, |
| 81 | + to='api.department'), |
| 82 | + ), |
| 83 | + migrations.AddField( |
| 84 | + model_name='user', |
| 85 | + name='groups', |
| 86 | + field=models.ManyToManyField(blank=True, |
| 87 | + help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', |
| 88 | + related_name='user_set', related_query_name='user', to='auth.group', |
| 89 | + verbose_name='groups'), |
| 90 | + ), |
| 91 | + migrations.AddField( |
| 92 | + model_name='user', |
| 93 | + name='user_permissions', |
| 94 | + field=models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', |
| 95 | + related_name='user_set', related_query_name='user', to='auth.permission', |
| 96 | + verbose_name='user permissions'), |
| 97 | + ), |
| 98 | + ] |
0 commit comments