0001_initial.py 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. # Generated by Django 3.0.8 on 2020-08-03 07:49
  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='Route',
  13. fields=[
  14. ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  15. ('name', models.CharField(max_length=80, verbose_name='name')),
  16. ('title', models.CharField(max_length=80, verbose_name='title')),
  17. ('url', models.CharField(max_length=80, verbose_name='name')),
  18. ('lft', models.PositiveIntegerField(editable=False)),
  19. ('rght', models.PositiveIntegerField(editable=False)),
  20. ('tree_id', models.PositiveIntegerField(db_index=True, editable=False)),
  21. ('level', models.PositiveIntegerField(editable=False)),
  22. ('parent', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='pid', to='power.Route', verbose_name='上级')),
  23. ],
  24. options={
  25. 'abstract': False,
  26. },
  27. ),
  28. migrations.CreateModel(
  29. name='UserRoute',
  30. fields=[
  31. ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  32. ('route', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='ur_user', to='power.Route', verbose_name='路由')),
  33. ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='ur_user', to=settings.AUTH_USER_MODEL, verbose_name='用户')),
  34. ],
  35. options={
  36. 'unique_together': {('user', 'route')},
  37. },
  38. ),
  39. ]