Skip to content

Commit

Permalink
feat(user profile): use user id as primary key of user profile
Browse files Browse the repository at this point in the history
  • Loading branch information
kjy2844 committed Apr 29, 2022
1 parent 1c6ea5a commit e393e1b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Generated by Django 4.0.2 on 2022-04-29 05:28

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('app', '0006_userprofile_major'),
]

operations = [
migrations.RemoveField(
model_name='userprofile',
name='id',
),
migrations.AlterField(
model_name='userprofile',
name='user',
field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='profile', serialize=False, to=settings.AUTH_USER_MODEL, verbose_name='사용자'),
),
]
1 change: 1 addition & 0 deletions app/models/user_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class UserProfile(models.Model):
related_name='profile',
on_delete=models.CASCADE,
verbose_name='사용자',
primary_key=True,
)
gender = models.BooleanField(
default=None,
Expand Down

0 comments on commit e393e1b

Please sign in to comment.