|
| 1 | +# Generated by Django 3.2.23 on 2024-03-27 06:49 |
| 2 | + |
| 3 | +from django.conf import settings |
| 4 | +from django.db import migrations, models |
| 5 | +import django.db.models.deletion |
| 6 | +import django.utils.timezone |
| 7 | + |
| 8 | + |
| 9 | +class Migration(migrations.Migration): |
| 10 | + |
| 11 | + initial = True |
| 12 | + |
| 13 | + dependencies = [ |
| 14 | + migrations.swappable_dependency(settings.AUTH_USER_MODEL), |
| 15 | + ] |
| 16 | + |
| 17 | + operations = [ |
| 18 | + migrations.CreateModel( |
| 19 | + name='Degree', |
| 20 | + fields=[ |
| 21 | + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
| 22 | + ('program', models.CharField(choices=[('EU_BSE', 'Engineering BSE'), ('EU_BAS', 'Engineering BAS'), ('AU_BA', 'College BA'), ('WU_BS', 'Wharton BS'), ('NU_BSN', 'Nursing BSN')], help_text='\nThe program code for this degree, e.g., EU_BSE\n', max_length=10)), |
| 23 | + ('degree', models.CharField(help_text='\nThe degree code for this degree, e.g., BSE\n', max_length=4)), |
| 24 | + ('major', models.CharField(help_text='\nThe major code for this degree, e.g., BIOL\n', max_length=4)), |
| 25 | + ('concentration', models.CharField(help_text='\nThe concentration code for this degree, e.g., BMAT\n', max_length=4, null=True)), |
| 26 | + ('year', models.IntegerField(help_text='\nThe effective year of this degree, e.g., 2023\n')), |
| 27 | + ('credits', models.DecimalField(decimal_places=2, help_text='\nThe minimum number of CUs required for this degree.\n', max_digits=4)), |
| 28 | + ], |
| 29 | + ), |
| 30 | + migrations.CreateModel( |
| 31 | + name='DegreePlan', |
| 32 | + fields=[ |
| 33 | + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
| 34 | + ('name', models.CharField(help_text="The user's nickname for the degree plan.", max_length=255)), |
| 35 | + ('created_at', models.DateTimeField(auto_now_add=True)), |
| 36 | + ('updated_at', models.DateTimeField(auto_now=True)), |
| 37 | + ('degrees', models.ManyToManyField(blank=True, help_text='The degrees this degree plan is associated with.', to='degree.Degree')), |
| 38 | + ('person', models.ForeignKey(help_text='The user the degree plan belongs to.', on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), |
| 39 | + ], |
| 40 | + ), |
| 41 | + migrations.CreateModel( |
| 42 | + name='Rule', |
| 43 | + fields=[ |
| 44 | + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
| 45 | + ('title', models.CharField(blank=True, help_text='\nThe title for this rule.\n', max_length=200)), |
| 46 | + ('num', models.PositiveSmallIntegerField(help_text='\nThe minimum number of courses or subrules required for this rule.\n', null=True)), |
| 47 | + ('credits', models.DecimalField(decimal_places=2, help_text='\nThe minimum number of CUs required for this rule. Only non-null\nif this is a Rule leaf.\n', max_digits=4, null=True)), |
| 48 | + ('q', models.TextField(blank=True, help_text='\nString representing a Q() object that returns the set of courses\nsatisfying this rule. Non-empty iff this is a Rule leaf.\nThis Q object is expected to be normalized before it is serialized\nto a string.\n', max_length=1000)), |
| 49 | + ('parent', models.ForeignKey(help_text="\nThis rule's parent Rule if it has one. Null if this is a top level rule\n(i.e., this rule belongs to some Degree's `.rules` set).\n", null=True, on_delete=django.db.models.deletion.CASCADE, related_name='children', to='degree.rule')), |
| 50 | + ], |
| 51 | + ), |
| 52 | + migrations.CreateModel( |
| 53 | + name='SatisfactionStatus', |
| 54 | + fields=[ |
| 55 | + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
| 56 | + ('satisfied', models.BooleanField(default=False, help_text='Whether the rule is satisfied')), |
| 57 | + ('last_updated', models.DateTimeField(auto_now=True)), |
| 58 | + ('last_checked', models.DateTimeField(default=django.utils.timezone.now)), |
| 59 | + ('degree_plan', models.ForeignKey(help_text='The degree plan that leads to the satisfaction of the rule', on_delete=django.db.models.deletion.CASCADE, related_name='satisfactions', to='degree.degreeplan')), |
| 60 | + ('rule', models.ForeignKey(help_text='The rule that is satisfied', on_delete=django.db.models.deletion.CASCADE, related_name='+', to='degree.rule')), |
| 61 | + ], |
| 62 | + ), |
| 63 | + migrations.CreateModel( |
| 64 | + name='PDPBetaUser', |
| 65 | + fields=[ |
| 66 | + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
| 67 | + ('created_at', models.DateTimeField(auto_now_add=True)), |
| 68 | + ('person', models.ForeignKey(help_text='The user who has access to the PDP beta', on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), |
| 69 | + ], |
| 70 | + ), |
| 71 | + migrations.CreateModel( |
| 72 | + name='Fulfillment', |
| 73 | + fields=[ |
| 74 | + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
| 75 | + ('full_code', models.CharField(blank=True, db_index=True, help_text='The dash-joined department and code of the course, e.g., `CIS-120`', max_length=16)), |
| 76 | + ('semester', models.CharField(help_text='\nThe semester of the course (of the form YYYYx where x is A [for spring],\nB [summer], or C [fall]), e.g. `2019C` for fall 2019. Null if this fulfillment\ndoes not yet have a semester.\n', max_length=5, null=True)), |
| 77 | + ('degree_plan', models.ForeignKey(help_text='The degree plan with which this fulfillment is associated', on_delete=django.db.models.deletion.CASCADE, related_name='fulfillments', to='degree.degreeplan')), |
| 78 | + ('rules', models.ManyToManyField(blank=True, help_text='\nThe rules this course fulfills. Blank if this course does not apply\nto any rules.\n', related_name='_degree_fulfillment_rules_+', to='degree.Rule')), |
| 79 | + ], |
| 80 | + ), |
| 81 | + migrations.CreateModel( |
| 82 | + name='DoubleCountRestriction', |
| 83 | + fields=[ |
| 84 | + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
| 85 | + ('max_courses', models.PositiveSmallIntegerField(help_text='\nThe maximum number of courses you can count for both rules.\nIf null, there is no limit, and max_credits must not be null.\n', null=True)), |
| 86 | + ('max_credits', models.DecimalField(decimal_places=2, help_text='\nThe maximum number of CUs you can count for both rules.\nIf null, there is no limit, and max_credits must not be null.\n', max_digits=4, null=True)), |
| 87 | + ('other_rule', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to='degree.rule')), |
| 88 | + ('rule', models.ForeignKey(help_text='\nA rule in the double count restriction.\n', on_delete=django.db.models.deletion.CASCADE, related_name='+', to='degree.rule')), |
| 89 | + ], |
| 90 | + ), |
| 91 | + migrations.CreateModel( |
| 92 | + name='DockedCourse', |
| 93 | + fields=[ |
| 94 | + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
| 95 | + ('full_code', models.CharField(blank=True, db_index=True, help_text='The dash-joined department and code of the course, e.g., `CIS-120`', max_length=16)), |
| 96 | + ('person', models.ForeignKey(help_text='The user the docked course belongs to.', on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), |
| 97 | + ], |
| 98 | + ), |
| 99 | + migrations.AddField( |
| 100 | + model_name='degree', |
| 101 | + name='rules', |
| 102 | + field=models.ManyToManyField(blank=True, help_text='\nThe rules for this degree. Blank if this degree has no rules.\n', related_name='degrees', to='degree.Rule'), |
| 103 | + ), |
| 104 | + migrations.AddConstraint( |
| 105 | + model_name='satisfactionstatus', |
| 106 | + constraint=models.UniqueConstraint(fields=('degree_plan', 'rule'), name='unique_satisfaction'), |
| 107 | + ), |
| 108 | + migrations.AlterUniqueTogether( |
| 109 | + name='fulfillment', |
| 110 | + unique_together={('degree_plan', 'full_code')}, |
| 111 | + ), |
| 112 | + migrations.AddConstraint( |
| 113 | + model_name='dockedcourse', |
| 114 | + constraint=models.UniqueConstraint(fields=('person', 'full_code'), name='unique docked course'), |
| 115 | + ), |
| 116 | + migrations.AddConstraint( |
| 117 | + model_name='degreeplan', |
| 118 | + constraint=models.UniqueConstraint(fields=('name', 'person'), name='degreeplan_name_person'), |
| 119 | + ), |
| 120 | + migrations.AddConstraint( |
| 121 | + model_name='degree', |
| 122 | + constraint=models.UniqueConstraint(fields=('program', 'degree', 'major', 'concentration', 'year'), name='unique degree'), |
| 123 | + ), |
| 124 | + ] |
0 commit comments