diff --git a/cfl_common/common/migrations/0053_clean_class_data.py b/cfl_common/common/migrations/0053_clean_class_data.py new file mode 100644 index 000000000..475ddfa89 --- /dev/null +++ b/cfl_common/common/migrations/0053_clean_class_data.py @@ -0,0 +1,17 @@ +from django.db import migrations, models + +def clean_dirty_data(apps: Apps, *args): + Class = apps.get_model("common", "Class") + + Class.objects.filter( + creation_time.year = 2015 + ).update(creation_time = null) + +class Migration(migrations.Migration): + dependencies = [("common", "0052_add_cse_fields")], + operations = [ + migrations.RunPython( + code=clean_dirty_data, + reverse_code=migrations.RunPython.noop, + ), + ] \ No newline at end of file