Add OneToOne relation, fix image dir path

This commit is contained in:
Andrew Smirnov 2021-02-04 20:41:11 +03:00
parent 5e5bec6028
commit 9b52630cf4
No known key found for this signature in database
GPG Key ID: 0EFE318E5BB2A82A

View File

@ -1,6 +1,8 @@
# Generated by Django 3.1.6 on 2021-02-04 17:36 # Generated by Django 3.1.6 on 2021-02-04 17:39
from django.conf import settings
from django.db import migrations, models from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration): class Migration(migrations.Migration):
@ -8,6 +10,7 @@ class Migration(migrations.Migration):
initial = True initial = True
dependencies = [ dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
] ]
operations = [ operations = [
@ -16,7 +19,8 @@ class Migration(migrations.Migration):
fields=[ fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('role', models.IntegerField()), ('role', models.IntegerField()),
('image', models.ImageField(upload_to='media/user_avatars')), ('image', models.ImageField(upload_to='user_avatars')),
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
], ],
), ),
] ]