|
@@ -0,0 +1,73 @@
|
|
|
+# Generated by Django 3.0.8 on 2020-07-23 08:39
|
|
|
+
|
|
|
+from django.conf import settings
|
|
|
+from django.db import migrations, models
|
|
|
+import django.db.models.deletion
|
|
|
+import mptt.fields
|
|
|
+
|
|
|
+
|
|
|
+class Migration(migrations.Migration):
|
|
|
+
|
|
|
+ initial = True
|
|
|
+
|
|
|
+ dependencies = [
|
|
|
+ migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
|
|
+ ]
|
|
|
+
|
|
|
+ operations = [
|
|
|
+ migrations.CreateModel(
|
|
|
+ name='Department',
|
|
|
+ fields=[
|
|
|
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
|
+ ('name', models.CharField(max_length=20)),
|
|
|
+ ('lft', models.PositiveIntegerField(editable=False)),
|
|
|
+ ('rght', models.PositiveIntegerField(editable=False)),
|
|
|
+ ('tree_id', models.PositiveIntegerField(db_index=True, editable=False)),
|
|
|
+ ('level', models.PositiveIntegerField(editable=False)),
|
|
|
+ ('parent', mptt.fields.TreeForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='treeAndTable.Department')),
|
|
|
+ ],
|
|
|
+ options={
|
|
|
+ 'verbose_name': '部门表',
|
|
|
+ 'verbose_name_plural': '部门列表',
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ migrations.CreateModel(
|
|
|
+ name='Job',
|
|
|
+ fields=[
|
|
|
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
|
+ ('name', models.CharField(max_length=20)),
|
|
|
+ ],
|
|
|
+ options={
|
|
|
+ 'verbose_name': '岗位表',
|
|
|
+ 'verbose_name_plural': '学校部门树形结构列表',
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ migrations.CreateModel(
|
|
|
+ name='Dept_job',
|
|
|
+ fields=[
|
|
|
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
|
+ ('dept', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='treeAndTable.Department')),
|
|
|
+ ('job', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='treeAndTable.Job')),
|
|
|
+ ],
|
|
|
+ options={
|
|
|
+ 'verbose_name': '部门岗位表',
|
|
|
+ 'verbose_name_plural': '部门岗位关联表',
|
|
|
+ 'db_table': 'dept_job',
|
|
|
+ 'unique_together': {('dept', 'job')},
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ migrations.CreateModel(
|
|
|
+ name='Dept_job_user',
|
|
|
+ fields=[
|
|
|
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
|
+ ('dept_job', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='treeAndTable.Dept_job')),
|
|
|
+ ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
|
|
|
+ ],
|
|
|
+ options={
|
|
|
+ 'verbose_name': '部门岗位关联人员表',
|
|
|
+ 'verbose_name_plural': '部门岗位关联人员关联表',
|
|
|
+ 'db_table': 'dept_job_user',
|
|
|
+ 'unique_together': {('dept_job', 'user')},
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ ]
|