From aac62e2ac748246d384bc3bfe7447cf0aa5d3040 Mon Sep 17 00:00:00 2001 From: bettleChen <2207153529@qq.com> Date: Wed, 6 Sep 2023 14:05:31 +0800 Subject: [PATCH] make migrations and migrate --- .../Eduadmin/migrations/0001_initial.py | 25 +++++++++ .../Student/migrations/0001_initial.py | 32 ++++++++++++ .../course/migrations/0001_initial.py | 51 +++++++++++++++++++ .../teacher/migrations/0001_initial.py | 30 +++++++++++ 4 files changed, 138 insertions(+) create mode 100644 EduSystemServer/Eduadmin/migrations/0001_initial.py create mode 100644 EduSystemServer/Student/migrations/0001_initial.py create mode 100644 EduSystemServer/course/migrations/0001_initial.py create mode 100644 EduSystemServer/teacher/migrations/0001_initial.py diff --git a/EduSystemServer/Eduadmin/migrations/0001_initial.py b/EduSystemServer/Eduadmin/migrations/0001_initial.py new file mode 100644 index 0000000..ba7ca6f --- /dev/null +++ b/EduSystemServer/Eduadmin/migrations/0001_initial.py @@ -0,0 +1,25 @@ +# Generated by Django 2.1 on 2023-09-06 14:02 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Admin', + fields=[ + ('username', models.CharField(max_length=32, primary_key=True, serialize=False, verbose_name='管理员账号')), + ('password', models.CharField(max_length=128, verbose_name='管理员密码')), + ], + options={ + 'verbose_name': '管理员', + 'db_table': 'Eduadmin', + }, + ), + ] diff --git a/EduSystemServer/Student/migrations/0001_initial.py b/EduSystemServer/Student/migrations/0001_initial.py new file mode 100644 index 0000000..8f2dab4 --- /dev/null +++ b/EduSystemServer/Student/migrations/0001_initial.py @@ -0,0 +1,32 @@ +# Generated by Django 2.1 on 2023-09-06 14:01 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Student', + fields=[ + ('sid', models.IntegerField(primary_key=True, serialize=False, verbose_name='学生编号')), + ('s_username', models.CharField(max_length=30, verbose_name='用户名称')), + ('s_password', models.CharField(max_length=100, verbose_name='密码')), + ('s_name', models.CharField(max_length=100, verbose_name='姓名')), + ('s_sex', models.CharField(max_length=4, verbose_name='性别')), + ('s_grade', models.IntegerField(verbose_name='年级')), + ('s_class_name', models.CharField(max_length=50, verbose_name='班级')), + ('s_major', models.CharField(max_length=50, verbose_name='专业名称')), + ], + options={ + 'verbose_name': '学生', + 'verbose_name_plural': '学生', + 'db_table': 'student', + }, + ), + ] diff --git a/EduSystemServer/course/migrations/0001_initial.py b/EduSystemServer/course/migrations/0001_initial.py new file mode 100644 index 0000000..7155d7a --- /dev/null +++ b/EduSystemServer/course/migrations/0001_initial.py @@ -0,0 +1,51 @@ +# Generated by Django 2.1 on 2023-09-06 14:01 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ('Student', '0001_initial'), + ('teacher', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='Course', + fields=[ + ('cid', models.AutoField(primary_key=True, serialize=False, verbose_name='课程编号')), + ('c_name', models.CharField(max_length=255, verbose_name='课程名称')), + ('c_type', models.CharField(max_length=128, verbose_name='课程类型')), + ('credit', models.IntegerField(verbose_name='课程学分')), + ('tid', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='teacher.Teacher')), + ], + options={ + 'verbose_name': '课程', + 'verbose_name_plural': '课程', + 'db_table': 'course', + }, + ), + migrations.CreateModel( + name='SC', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('middle_grade', models.IntegerField()), + ('end_grade', models.IntegerField()), + ('cid', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='course.Course')), + ('sid', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='Student.Student')), + ], + options={ + 'verbose_name': '管理员', + 'verbose_name_plural': '管理员', + 'db_table': 'sc', + }, + ), + migrations.AlterUniqueTogether( + name='sc', + unique_together={('sid', 'cid')}, + ), + ] diff --git a/EduSystemServer/teacher/migrations/0001_initial.py b/EduSystemServer/teacher/migrations/0001_initial.py new file mode 100644 index 0000000..b8454b3 --- /dev/null +++ b/EduSystemServer/teacher/migrations/0001_initial.py @@ -0,0 +1,30 @@ +# Generated by Django 2.1 on 2023-09-06 14:01 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Teacher', + fields=[ + ('tid', models.AutoField(primary_key=True, serialize=False, verbose_name='教师编号')), + ('t_name', models.CharField(max_length=255, verbose_name='教师名称')), + ('t_sex', models.CharField(max_length=128, verbose_name='教师性别')), + ('t_title', models.CharField(max_length=128, verbose_name='教师职称')), + ('t_education', models.CharField(max_length=128, verbose_name='教师学历')), + ('t_dept', models.CharField(max_length=128, verbose_name='教师所属院系')), + ], + options={ + 'verbose_name': '教师', + 'verbose_name_plural': '教师', + 'db_table': 'teacher', + }, + ), + ]