101 lines
5.7 KiB
Python
101 lines
5.7 KiB
Python
# Generated by Django 5.2.3 on 2025-06-15 16:51
|
|
|
|
import django.core.validators
|
|
import django.db.models.deletion
|
|
import django.utils.timezone
|
|
import uuid
|
|
from django.conf import settings
|
|
from django.db import migrations, models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
initial = True
|
|
|
|
dependencies = [
|
|
('auth', '0012_alter_user_first_name_max_length'),
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name='User',
|
|
fields=[
|
|
('password', models.CharField(max_length=128, verbose_name='password')),
|
|
('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
|
|
('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
|
|
('first_name', models.CharField(blank=True, max_length=150, verbose_name='first name')),
|
|
('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')),
|
|
('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
|
|
('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
|
|
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
|
|
('email', models.EmailField(max_length=254, unique=True)),
|
|
('phone', models.CharField(blank=True, max_length=10, null=True, unique=True, validators=[django.core.validators.RegexValidator(message='Phone number must be 10 digits.', regex='^\\d{10}$')])),
|
|
('is_active', models.BooleanField(default=False)),
|
|
('is_alumni', models.BooleanField(default=True)),
|
|
('is_staff_member', models.BooleanField(default=False)),
|
|
('is_admin', models.BooleanField(default=False)),
|
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
|
('updated_at', models.DateTimeField(auto_now=True)),
|
|
('last_active', models.DateTimeField(blank=True, null=True)),
|
|
('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')),
|
|
('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')),
|
|
],
|
|
),
|
|
migrations.CreateModel(
|
|
name='UserProfile',
|
|
fields=[
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('avatar', models.ImageField(blank=True, null=True, upload_to='avatars/')),
|
|
('bio', models.TextField(blank=True, max_length=500)),
|
|
('location', models.CharField(blank=True, max_length=100)),
|
|
('graduation_year', models.PositiveIntegerField(blank=True, null=True)),
|
|
('degree', models.CharField(blank=True, max_length=100)),
|
|
('major', models.CharField(blank=True, max_length=100)),
|
|
('current_company', models.CharField(blank=True, max_length=100)),
|
|
('current_position', models.CharField(blank=True, max_length=100)),
|
|
('linkedin_url', models.URLField(blank=True)),
|
|
('website_url', models.URLField(blank=True)),
|
|
('privacy_level', models.CharField(choices=[('public', 'Public'), ('alumni_only', 'Alumni Only'), ('private', 'Private')], default='alumni_only', max_length=20)),
|
|
('notification_preferences', models.JSONField(default=dict)),
|
|
('is_mentor_available', models.BooleanField(default=False)),
|
|
('mentor_skills', models.JSONField(default=list)),
|
|
('is_job_seeking', models.BooleanField(default=False)),
|
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
|
('updated_at', models.DateTimeField(auto_now=True)),
|
|
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='profile', to=settings.AUTH_USER_MODEL)),
|
|
],
|
|
options={
|
|
'verbose_name': 'User Profile',
|
|
'verbose_name_plural': 'User Profiles',
|
|
},
|
|
),
|
|
migrations.AddIndex(
|
|
model_name='user',
|
|
index=models.Index(fields=['email'], name='user_email_idx'),
|
|
),
|
|
migrations.AddIndex(
|
|
model_name='user',
|
|
index=models.Index(fields=['phone'], name='user_phone_idx'),
|
|
),
|
|
migrations.AddIndex(
|
|
model_name='user',
|
|
index=models.Index(fields=['first_name', 'last_name'], name='user_name_idx'),
|
|
),
|
|
migrations.AddIndex(
|
|
model_name='userprofile',
|
|
index=models.Index(fields=['graduation_year'], name='profile_grad_year_idx'),
|
|
),
|
|
migrations.AddIndex(
|
|
model_name='userprofile',
|
|
index=models.Index(fields=['current_company'], name='profile_company_idx'),
|
|
),
|
|
migrations.AddIndex(
|
|
model_name='userprofile',
|
|
index=models.Index(fields=['is_mentor_available'], name='profile_mentor_idx'),
|
|
),
|
|
migrations.AddIndex(
|
|
model_name='userprofile',
|
|
index=models.Index(fields=['is_job_seeking'], name='profile_jobseek_idx'),
|
|
),
|
|
]
|