Skip to content
Snippets Groups Projects

Support multiple columns in column copy triggers

Merged Patrick Bair requested to merge pb-int-conversion-update-multiple-columns into master

What does this MR do?

Relates to #326569 (closed)

In migration helpers we use "rename" triggers for certain migrations, whenever we need to ensure a destination column keeps the same value as a source column. We need to extend this functionality to support multiple source and destination columns, for migrations where we need to update more than one column at a time. At the same time, we need to maintain backwards compatibility with existing behavior to not break any existing migrations.

That means the install_rename_triggers and related functions should:

  1. Create triggers with the same names, same behavior, and same syntax (to prevent diff in structure.sql)
  2. Retain compatibility with their existing method signature, while also supporting arrays of column names

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • [-] Label as security and @ mention @gitlab-com/gl-security/appsec
  • [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • [-] Security reports checked/validated by a reviewer from the AppSec team
Edited by Mayra Cabrera

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Mehmet Emin INAC
  • Mehmet Emin INAC approved this merge request

    approved this merge request

  • Mehmet Emin INAC requested review from @cablett and removed review request for @minac

    requested review from @cablett and removed review request for @minac

  • Patrick Bair added 462 commits

    added 462 commits

    Compare with previous version

  • Patrick Bair requested review from @abrandl

    requested review from @abrandl

  • charlie ablett requested review from @mayra-cabrera and removed review request for @cablett

    requested review from @mayra-cabrera and removed review request for @cablett

  • Mayra Cabrera
  • Mayra Cabrera
  • Mayra Cabrera removed review request for @mayra-cabrera

    removed review request for @mayra-cabrera

  • I'll take over this one as DRI while Pat is away.

  • Krasimir Angelov assigned to @krasio and unassigned @pbair

    assigned to @krasio and unassigned @pbair

  • Krasimir Angelov removed review request for @abrandl

    removed review request for @abrandl

  • requested review from @mayra-cabrera

  • Krasimir Angelov requested review from @abrandl

    requested review from @abrandl

  • mentioned in commit af86e8bd

  • mentioned in commit 2846849e

  • Krasimir Angelov added 2637 commits

    added 2637 commits

    • 66f74541...6194c76a - 2634 commits from branch master
    • 3754bc0b - Support multiple columns in column copy triggers
    • af86e8bd - Make trigger name optional for install_rename_triggers_for_postgresql
    • 2846849e - Update UnidirectionalCopyTrigger to applu code review sugegstions

    Compare with previous version

  • mentioned in issue #326569 (closed)

  • Andreas Brandl
  • Andreas Brandl approved this merge request

    approved this merge request

  • @krasio Thanks for picking this up! I've been testing this in !59638 (closed) and it looks great - LGTM! :thumbsup:

    @mayra-cabrera Once backend looks good, please feel free to merge. :rocket:

  • Please register or sign in to reply
    Loading