Skip to content

Clean unique field conflicts in pre-migration #3443

@luisa-beerboom

Description

@luisa-beerboom

There's the possibility that old broken data, that doesn't keep the new unique constraints, exists in legacy instances.
To avoid breaking the relDB migration, these conflicts need to be migrated as such:

  • chat_group.yml: meeting_id, name -> When in doubt add (2) behind name
  • gender.yml: name -> When in doubt add (2) behind name
  • mediafile.yml: titel, parent_id, owner_id -> When in doubt add (2) behind title
  • mediafile.yml: token -> Arbitrarily change all but one
  • motion_comment.yml -> motion_id, section_id -> Append one comment text to one comment, delete the other comment
  • motion_editor/working_group_speaker/submitter/supporter: meeting_user_id, motion_id -> delete the model that has the higher weight.
  • motion_state.yml: name, workflow -> When in doubt add (2) behind name
  • personal_note.yml: meeting_user_id, content_object_id -> Append one comment text to one comment, delete the other comment
  • projector_countdown.yml: meeting_id, title -> When in doubt add (2) behind title
  • structure_level.yml: meeting_id, name -> When in doubt add (2) behind name

needs discussion:

  • option.yml: text, poll_id (this constraint does not exist/work pre-relDB) -> Could add (2) (legal issues?), could delete the unique constraint, could throw error -> needs_discussion with @ostcar and perhaps its own issue
    -> discussed with @ostcar : Remove the constraint. This'll need to be it's own issue.

Raise Errors -> Raise verbose errors to stop migration, bc it will need to be handled on a case-by-case basis (possibly aggregate errors):

  • committee.yml: external_id -> Error
  • group.yml: meeting_id, external_id -> Error
  • meeting.yml: external_id -> Error
  • meeting_user.yml: meeting_id, user_id -> Error
  • motion.yml: meeting_id, number -> Error
  • option.yml: content_object_id, poll_id -> Error
  • structure_level_list_of_speakers.yml: meeting_id, structure_level_id, list_of_speakers_id -> Error
  • user.yml: username -> Error
  • user.yml: member_number -> Error
  • user.yml: saml_id -> Error

Metadata

Metadata

Labels

highmigrationIntroduces a new migration

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions