From 4a8f3b4ac0e97d38515377425b5305e08b48e713 Mon Sep 17 00:00:00 2001 From: Martin Beracochea Date: Wed, 7 Feb 2024 21:57:56 +0000 Subject: [PATCH] Add an extra migrate step to rename last_indexed -> last_ebi_search_indexed This is needed because RenameField doesn't allow you to change the db_column name. With this change it seems to work, and the data should be kept: ```sql -- -- Alter field last_indexed on analysisjob -- ALTER TABLE "ANALYSIS_JOB" RENAME COLUMN "LAST_INDEXED" TO "LAST_EBI_SEARCH_INDEXED"; -- -- Alter field last_indexed on study -- ALTER TABLE "STUDY" RENAME COLUMN "LAST_INDEXED" TO "LAST_EBI_SEARCH_INDEXED"; -- -- Rename field last_indexed on analysisjob to last_ebi_search_indexed -- -- -- Rename field last_indexed on study to last_ebi_search_indexed -- ``` --- emgapi/migrations/0017_auto_20240129_1401.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/emgapi/migrations/0017_auto_20240129_1401.py b/emgapi/migrations/0017_auto_20240129_1401.py index 9bf204673..a45176c9e 100644 --- a/emgapi/migrations/0017_auto_20240129_1401.py +++ b/emgapi/migrations/0017_auto_20240129_1401.py @@ -10,6 +10,16 @@ class Migration(migrations.Migration): ] operations = [ + migrations.AlterField( + model_name='analysisjob', + name='last_indexed', + field=models.DateTimeField(blank=True, db_column='LAST_EBI_SEARCH_INDEXED', help_text='Date at which this model was last included in an EBI Search initial/incremental index.', null=True), + ), + migrations.AlterField( + model_name='study', + name='last_indexed', + field=models.DateTimeField(blank=True, db_column='LAST_EBI_SEARCH_INDEXED', help_text='Date at which this model was last included in an EBI Search initial/incremental index.', null=True), + ), migrations.RenameField( model_name='analysisjob', old_name='last_indexed',