Mottimo commented on issue #24247:
URL: https://github.com/apache/airflow/issues/24247#issuecomment-1148413639

   Finally I got the first upgrade from 2.2.5 to 2.3.1 without errors. The 
applied steps are:
   
   1. Dump of the 2.2.5 DB and replacement of collate to utf8mb3_general_ci. 
This change was required to prevent two errors, one during the creation of new 
table task_map (type of foreign key does not match the referenced table), the 
other for incoherence between collates utf8mb3_unicode_ci and 
utf8mb3_general_ci;
   
   2. Update of the schema with the following statements, required because the 
migration script asks for them during drop operations:
   
   `
   --
   -- Drop column map_index from task_instance
   ALTER TABLE task_instance DROP COLUMN IF EXISTS map_index;
   --
   -- Drop column map_index from task_instance
   ALTER TABLE task_reschedule DROP COLUMN IF EXISTS map_index;
   --
   -- Create non-unique indexes on task_instance
   CREATE INDEX IF NOT EXISTS idx_task_reschedule_dag_task_run USING BTREE ON 
task_instance (dag_id, task_id, run_id);
   --
   -- Create non-unique indexes on task_reschedule
   CREATE INDEX IF NOT EXISTS idx_task_reschedule_dag_task_run USING BTREE ON 
task_reschedule (dag_id, task_id, run_id);
   --
   -- Create foreign key on task_reschedule
   ALTER TABLE task_reschedule ADD CONSTRAINT task_reschedule_ti_fkey FOREIGN 
KEY (dag_id, task_id, run_id) REFERENCES task_instance (dag_id, task_id, 
run_id);
   --
   -- Create primary key on task_instance
   ALTER TABLE task_instance ADD PRIMARY KEY (dag_id, task_id, run_id);
   `
   
   No change was applied to the DB for the sequences, just the patch provided 
by @ephraimbuddy was used.
   
   After these steps the upgrade was successfully completed, I don't know yet 
if it really works with the application.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to