Add migration helpers for copying check constraints
- 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
Showing
Please register or sign in to comment