0001_initial.py 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. # Generated by Django 3.0.8 on 2020-07-23 08:39
  2. from django.conf import settings
  3. from django.db import migrations, models
  4. import django.db.models.deletion
  5. import mptt.fields
  6. class Migration(migrations.Migration):
  7. initial = True
  8. dependencies = [
  9. migrations.swappable_dependency(settings.AUTH_USER_MODEL),
  10. ]
  11. operations = [
  12. migrations.CreateModel(
  13. name='Department',
  14. fields=[
  15. ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  16. ('name', models.CharField(max_length=20)),
  17. ('lft', models.PositiveIntegerField(editable=False)),
  18. ('rght', models.PositiveIntegerField(editable=False)),
  19. ('tree_id', models.PositiveIntegerField(db_index=True, editable=False)),
  20. ('level', models.PositiveIntegerField(editable=False)),
  21. ('parent', mptt.fields.TreeForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='treeAndTable.Department')),
  22. ],
  23. options={
  24. 'verbose_name': '部门表',
  25. 'verbose_name_plural': '部门列表',
  26. },
  27. ),
  28. migrations.CreateModel(
  29. name='Job',
  30. fields=[
  31. ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  32. ('name', models.CharField(max_length=20)),
  33. ],
  34. options={
  35. 'verbose_name': '岗位表',
  36. 'verbose_name_plural': '学校部门树形结构列表',
  37. },
  38. ),
  39. migrations.CreateModel(
  40. name='Dept_job',
  41. fields=[
  42. ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  43. ('dept', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='treeAndTable.Department')),
  44. ('job', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='treeAndTable.Job')),
  45. ],
  46. options={
  47. 'verbose_name': '部门岗位表',
  48. 'verbose_name_plural': '部门岗位关联表',
  49. 'db_table': 'dept_job',
  50. 'unique_together': {('dept', 'job')},
  51. },
  52. ),
  53. migrations.CreateModel(
  54. name='Dept_job_user',
  55. fields=[
  56. ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  57. ('dept_job', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='treeAndTable.Dept_job')),
  58. ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
  59. ],
  60. options={
  61. 'verbose_name': '部门岗位关联人员表',
  62. 'verbose_name_plural': '部门岗位关联人员关联表',
  63. 'db_table': 'dept_job_user',
  64. 'unique_together': {('dept_job', 'user')},
  65. },
  66. ),
  67. ]