-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: add migration to clean class data #2332
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @evemartin)
cfl_common/common/migrations/0053_clean_class_data.py
line 4 at r2 (raw file):
from django.db import migrations, models def clean_dirty_data(apps: Apps, *args):
Please give this a more descriptive name (the file name itself might be good enough)
cfl_common/common/migrations/0053_clean_class_data.py
line 8 at r2 (raw file):
Class.objects.filter( creation_time__year=2015
Let's actually make a migration that clears the creation time for any class that has a creation time earlier than the day we started tracking it (you should be able to check when the migration was made that adds the creation_time
field, that'll be the day we need to filter before).
I know it doesn't look like we have any classes other than those 16 in 2015 but let's still do that just in case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r3, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @evemartin)
cfl_common/common/migrations/0053_clean_class_data.py
line 8 at r3 (raw file):
Class.objects.filter( creation_time__date__gt = datetime.date(2021, 10, 15)
Needs to be lt
not gt
🙃
I have now successfully tested this on Dev! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r5, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @evemartin)
This change is