• Yannis Roussos's avatar
    Add migration helpers for copying check constraints · 8836e64d
    Yannis Roussos authored
    - Add check_constraints_for(table, column, schema: nil)
      private method to Gitlab::Database::MigrationHelpers.
      Returns all the check constraints defined for a column.
    - Add the copy_check_constraints(table, old, new, schema: nil)
      migration helper.
      It copies all co straints defined in column old to column new.
    - Update the create_column_from migration helper to
      also copy all existing check constraints to the new column.
    - Update the specs for all helpers that use create_column_from
      and add new specs for copy_check_constraints
    8836e64d
migration_helpers.rb 54.8 KB