Files
Django/jituan/migrations/0008_dashou_exam.py

84 lines
4.4 KiB
Python

from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('jituan', '0007_club_catalog_config'),
]
operations = [
migrations.CreateModel(
name='ClubDashouExamConfig',
fields=[
('club_id', models.CharField(max_length=16, primary_key=True, serialize=False)),
('is_enabled', models.BooleanField(default=False, verbose_name='是否开启考试')),
('draw_count', models.PositiveIntegerField(default=10, verbose_name='每次抽题数量')),
('pass_count', models.PositiveIntegerField(default=10, verbose_name='至少答对题数')),
('require_member', models.BooleanField(default=True, verbose_name='须开通会员方可考试')),
('CreateTime', models.DateTimeField(auto_now_add=True)),
('UpdateTime', models.DateTimeField(auto_now=True)),
],
options={'db_table': 'club_dashou_exam_config'},
),
migrations.CreateModel(
name='ClubDashouExamQuestion',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('club_id', models.CharField(db_index=True, max_length=16)),
('stem', models.TextField(verbose_name='题干文字')),
('question_type', models.IntegerField(default=1, verbose_name='1单选2多选')),
('option_1', models.CharField(blank=True, default='', max_length=500)),
('option_2', models.CharField(blank=True, default='', max_length=500)),
('option_3', models.CharField(blank=True, default='', max_length=500)),
('option_4', models.CharField(blank=True, default='', max_length=500)),
('option_5', models.CharField(blank=True, default='', max_length=500)),
('option_6', models.CharField(blank=True, default='', max_length=500)),
('correct_1', models.BooleanField(default=False)),
('correct_2', models.BooleanField(default=False)),
('correct_3', models.BooleanField(default=False)),
('correct_4', models.BooleanField(default=False)),
('correct_5', models.BooleanField(default=False)),
('correct_6', models.BooleanField(default=False)),
('explanation', models.TextField(blank=True, default='', verbose_name='错题解析')),
('is_enabled', models.BooleanField(default=True, verbose_name='是否上架')),
('sort_order', models.IntegerField(default=0)),
('CreateTime', models.DateTimeField(auto_now_add=True)),
('UpdateTime', models.DateTimeField(auto_now=True)),
],
options={
'db_table': 'club_dashou_exam_question',
'indexes': [models.Index(fields=['club_id', 'is_enabled'], name='club_dashou_exam_q_club_en_idx')],
},
),
migrations.CreateModel(
name='ClubDashouExamQuestionImage',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('club_id', models.CharField(db_index=True, max_length=16)),
('question_id', models.IntegerField(db_index=True)),
('image_url', models.CharField(max_length=500)),
('sort_order', models.IntegerField(default=0)),
('CreateTime', models.DateTimeField(auto_now_add=True)),
],
options={
'db_table': 'club_dashou_exam_question_image',
'indexes': [models.Index(fields=['club_id', 'question_id'], name='club_dashou_exam_img_q_idx')],
},
),
migrations.CreateModel(
name='ClubDashouExamPass',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('club_id', models.CharField(db_index=True, max_length=16)),
('yonghuid', models.CharField(db_index=True, max_length=7)),
('passed_at', models.DateTimeField(auto_now_add=True)),
('CreateTime', models.DateTimeField(auto_now_add=True)),
],
options={
'db_table': 'club_dashou_exam_pass',
'unique_together': {('club_id', 'yonghuid')},
},
),
]