0001_initial.py 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. # Generated by Django 3.2.5 on 2021-07-08 17:28
  2. from django.conf import settings
  3. from django.db import migrations, models
  4. import django.db.models.deletion
  5. class Migration(migrations.Migration):
  6. initial = True
  7. dependencies = [
  8. migrations.swappable_dependency(settings.AUTH_USER_MODEL),
  9. ]
  10. operations = [
  11. migrations.CreateModel(
  12. name='Profile',
  13. fields=[
  14. ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  15. ('phone', models.CharField(blank=True, max_length=20)),
  16. ('bio', models.TextField(blank=True, max_length=500)),
  17. ('avatar', models.ImageField(blank=True, upload_to='avatar/%Y%m%d/')),
  18. ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='profile', to=settings.AUTH_USER_MODEL)),
  19. ],
  20. ),
  21. migrations.CreateModel(
  22. name='Devices',
  23. fields=[
  24. ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  25. ('last_login_time', models.DateField(auto_now=True)),
  26. ('device_uid', models.CharField(default='233', max_length=100, unique=True)),
  27. ('token', models.CharField(default='233', max_length=100, unique=True)),
  28. ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='devices', to=settings.AUTH_USER_MODEL)),
  29. ],
  30. ),
  31. ]