From 12282cbdf8f40267bf40424db79e4c3167976a32 Mon Sep 17 00:00:00 2001 From: Muhammad Qasim Gulzar <19186089+qasimgulzar@users.noreply.github.com> Date: Fri, 15 Nov 2024 00:27:04 +0500 Subject: [PATCH] fix: Update the migration to make it compatible with postgresql and mysql. (#282) In PostgreSQL, AlterField for this specific instance was causing a crash when type casting from interval to double/float. --- .../migrations/0005_auto_20190911_1056.py | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/edx_when/migrations/0005_auto_20190911_1056.py b/edx_when/migrations/0005_auto_20190911_1056.py index 323ae5b..0b44a57 100644 --- a/edx_when/migrations/0005_auto_20190911_1056.py +++ b/edx_when/migrations/0005_auto_20190911_1056.py @@ -5,23 +5,35 @@ class Migration(migrations.Migration): - dependencies = [ ('edx_when', '0004_datepolicy_rel_date'), ] operations = [ - migrations.AlterField( + migrations.RemoveField( + model_name='datepolicy', + name='abs_date' + ), + migrations.AddField( model_name='datepolicy', name='abs_date', field=models.DateTimeField(blank=True, db_index=True, null=True), ), - migrations.AlterField( + migrations.RemoveField( + model_name='datepolicy', + name='rel_date' + ), + migrations.AddField( model_name='datepolicy', name='rel_date', field=models.DurationField(blank=True, db_index=True, null=True), ), - migrations.AlterField( + + migrations.RemoveField( + model_name='userdate', + name='rel_date' + ), + migrations.AddField( model_name='userdate', name='rel_date', field=models.DurationField(blank=True, db_index=True, null=True),