We're updating the issue view to help you get more done. 

Duplicate reminder counts cause 1.9 to 2.0 migration to fail

Description

If a 1.9 Reminder Type has duplicate reminder counts, dbtool --update fails with:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Updating to 1.9.0.8 - OVPMS-1922 ... Migration of schema `openvpms-1_8` to version 1.9.0.8 - OVPMS-1922 failed! Please restore backups and roll back database and code! org.flywaydb.core.internal.dbsupport.FlywaySqlScriptException: Migration V1.9.0.8__OVPMS-1922.sql failed ----------------------------------------- SQL State : 23000 Error Code : 1062 Message : Duplicate entry '1147-0' for key 'PRIMARY' Location : org/openvpms/db/migration/1.9/V1.9.0.8__OVPMS-1922.sql Line : 109 Statement : INSERT INTO tmp_reminder_type_count (entity_id, reminder_count, overdue_interval, overdue_units) SELECT reminder_type.entity_id, reminder_count_count.value, reminder_count_interval.value, reminder_count_units.value units FROM entities reminder_type JOIN entity_links lreminder_count ON lreminder_count.source_id = reminder_type.entity_id JOIN entities reminder_count ON lreminder_count.target_id = reminder_count.entity_id AND reminder_count.arch_short_name = 'entity.reminderCount' JOIN entity_details reminder_count_count ON reminder_count_count.entity_id = reminder_count.entity_id AND reminder_count_count.name = 'count' JOIN entity_details reminder_count_interval ON reminder_count_interval.entity_id = reminder_count.entity_id AND reminder_count_interval.name = 'interval' JOIN entity_details reminder_count_units ON reminder_count_units.entity_id = reminder_count.entity_id AND reminder_count_units.name = 'units' WHERE reminder_type.arch_short_name = 'entity.reminderType'

Environment

None

Status

Assignee

Tim Anderson

Reporter

Tim Anderson

Labels

None

Components

Fix versions

Affects versions

2.0

Priority

Major