0001_initial.py 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. # Generated by Django 3.2.5 on 2021-09-09 07:30
  2. import account.validators
  3. from django.db import migrations, models
  4. import django.db.models.deletion
  5. class Migration(migrations.Migration):
  6. initial = True
  7. dependencies = [
  8. ('folder', '0002_alter_folder_folder_name'),
  9. ]
  10. operations = [
  11. migrations.CreateModel(
  12. name='User',
  13. fields=[
  14. ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  15. ('username', models.CharField(error_messages={'unique': 'A _user with that username already exists.'}, help_text='Required. 25 characters or fewer. Letters, digits and _ only.', max_length=25, unique=True, validators=[account.validators.ASCIIUsernameValidator()], verbose_name='username')),
  16. ('password', models.CharField(max_length=128, verbose_name='password')),
  17. ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
  18. ('email', models.EmailField(max_length=254, unique=True, verbose_name='email address')),
  19. ],
  20. options={
  21. 'verbose_name': '用户信息表',
  22. 'verbose_name_plural': '用户信息表',
  23. 'db_table': '_user',
  24. },
  25. ),
  26. migrations.CreateModel(
  27. name='Profile',
  28. fields=[
  29. ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  30. ('root_folder', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='profile', to='folder.folder')),
  31. ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='profile', to='account.user')),
  32. ],
  33. ),
  34. migrations.CreateModel(
  35. name='LoginToken',
  36. fields=[
  37. ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  38. ('token', models.CharField(max_length=256)),
  39. ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='tokens', to='account.user')),
  40. ],
  41. ),
  42. ]