StudE-Backend/stude/subjects/migrations/0001_initial.py

40 lines
1.6 KiB
Python
Raw Normal View History

# Generated by Django 4.2.5 on 2023-10-01 16:37
2023-06-27 18:15:31 +08:00
from django.conf import settings
2023-06-27 18:15:31 +08:00
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('courses', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('year_levels', '0001_initial'),
('semesters', '0001_initial'),
2023-06-27 18:15:31 +08:00
]
operations = [
migrations.CreateModel(
name='Subject',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=64, unique=True)),
('students', models.ManyToManyField(blank=True, to=settings.AUTH_USER_MODEL)),
],
),
migrations.CreateModel(
name='SubjectInstance',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('code', models.CharField(max_length=16)),
('course', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='courses.course')),
('semester', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='semesters.semester')),
('subject', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='subjects.subject', to_field='name')),
('year_level', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='year_levels.year_level')),
],
),
2023-06-27 18:15:31 +08:00
]