InfoTech-Backend/infotech/schedules/migrations/0001_initial.py

46 lines
2 KiB
Python

# Generated by Django 4.2 on 2023-04-22 02:49
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('subjects', '0006_remove_subject_students'),
('professors', '0001_initial'),
('students', '0004_student_enrolled_subjects'),
]
operations = [
migrations.CreateModel(
name='Schedule',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('date_created', models.DateTimeField(default=django.utils.timezone.now, editable=False)),
('professor', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='Professor_last_name', to='professors.professor')),
],
),
migrations.CreateModel(
name='StudentSchedule',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('date_joined', models.DateTimeField(default=django.utils.timezone.now, editable=False)),
('schedule', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='schedules.schedule')),
('student_assigned', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='students.student')),
],
),
migrations.AddField(
model_name='schedule',
name='students_assigned',
field=models.ManyToManyField(related_name='StudentSchedule_student_assigned', through='schedules.StudentSchedule', to='students.student'),
),
migrations.AddField(
model_name='schedule',
name='subject',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='subjects.subject'),
),
]