0001_initial.py 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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='Dapt',
  13. fields=[
  14. ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  15. ('name', models.CharField(max_length=50)),
  16. ('lft', models.PositiveIntegerField(editable=False)),
  17. ('rght', models.PositiveIntegerField(editable=False)),
  18. ('tree_id', models.PositiveIntegerField(db_index=True, editable=False)),
  19. ('level', models.PositiveIntegerField(editable=False)),
  20. ('parent', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='pid', to='relation.Dapt', verbose_name='上级部门')),
  21. ],
  22. options={
  23. 'abstract': False,
  24. },
  25. ),
  26. migrations.CreateModel(
  27. name='Post',
  28. fields=[
  29. ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  30. ('name', models.CharField(max_length=50)),
  31. ],
  32. ),
  33. migrations.CreateModel(
  34. name='PostUser',
  35. fields=[
  36. ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  37. ('post', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='pu_post', to='relation.Post', verbose_name='岗位')),
  38. ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='pu_user', to=settings.AUTH_USER_MODEL, verbose_name='人员')),
  39. ],
  40. options={
  41. 'unique_together': {('post', 'user')},
  42. },
  43. ),
  44. migrations.CreateModel(
  45. name='DaptUser',
  46. fields=[
  47. ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  48. ('dapt', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='du_dapt', to='relation.Dapt', verbose_name='部门')),
  49. ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='du_user', to=settings.AUTH_USER_MODEL, verbose_name='人员')),
  50. ],
  51. options={
  52. 'unique_together': {('dapt', 'user')},
  53. },
  54. ),
  55. migrations.CreateModel(
  56. name='DaptPost',
  57. fields=[
  58. ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  59. ('dapt', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='dp_dapt', to='relation.Dapt', verbose_name='部门')),
  60. ('post', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='dp_post', to='relation.Post', verbose_name='岗位')),
  61. ],
  62. options={
  63. 'unique_together': {('dapt', 'post')},
  64. },
  65. ),
  66. ]