You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
63 lines
2.9 KiB
63 lines
2.9 KiB
from django.db import migrations, models
|
|
import django.db.models.deletion
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
initial = True
|
|
|
|
dependencies = [
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name='AdminInfo',
|
|
fields=[
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('username', models.CharField(max_length=32, verbose_name='用户名')),
|
|
('password', models.CharField(max_length=64, verbose_name='密码')),
|
|
],
|
|
),
|
|
migrations.CreateModel(
|
|
name='CourseInfo',
|
|
fields=[
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('course_name', models.CharField(max_length=32, verbose_name='课程名称')),
|
|
('course_brief', models.CharField(default='无', max_length=128, verbose_name='课程介绍')),
|
|
('class_hour', models.SmallIntegerField(verbose_name='课时')),
|
|
('points', models.SmallIntegerField(verbose_name='学分')),
|
|
],
|
|
),
|
|
migrations.CreateModel(
|
|
name='Department',
|
|
fields=[
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('department_name', models.CharField(max_length=32, verbose_name='学院名')),
|
|
],
|
|
),
|
|
migrations.CreateModel(
|
|
name='Select',
|
|
fields=[
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('course', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app01.courseinfo', verbose_name='课程')),
|
|
],
|
|
),
|
|
migrations.CreateModel(
|
|
name='StuInfo',
|
|
fields=[
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('username', models.CharField(max_length=32, unique=True, verbose_name='用户名')),
|
|
('password', models.CharField(max_length=64, verbose_name='密码')),
|
|
('name', models.CharField(max_length=32, verbose_name='姓名')),
|
|
('gender', models.SmallIntegerField(choices=[(1, '男'), (2, '女')], verbose_name='性别')),
|
|
('course', models.ManyToManyField(through='app01.Select', to='app01.CourseInfo')),
|
|
('department', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app01.department', verbose_name='学院')),
|
|
],
|
|
),
|
|
migrations.AddField(
|
|
model_name='select',
|
|
name='student',
|
|
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app01.stuinfo', verbose_name='学生'),
|
|
),
|
|
]
|