]> git.openstreetmap.org Git - rails.git/blob - db/migrate/20240307181018_validate_and_modify_redaction_title_and_description.rb
Merge remote-tracking branch 'upstream/pull/5315'
[rails.git] / db / migrate / 20240307181018_validate_and_modify_redaction_title_and_description.rb
1 class ValidateAndModifyRedactionTitleAndDescription < ActiveRecord::Migration[7.1]
2   disable_ddl_transaction!
3
4   def up
5     validate_check_constraint :redactions, :name => "redaction_title_not_null"
6     validate_check_constraint :redactions, :name => "redaction_description_not_null"
7
8     change_column_null :redactions, :title, false
9     change_column_null :redactions, :description, false
10
11     remove_check_constraint :redactions, :name => "redaction_title_not_null"
12     remove_check_constraint :redactions, :name => "redaction_description_not_null"
13   end
14
15   def down
16     change_column_null :redactions, :title, true
17     change_column_null :redactions, :description, true
18   end
19 end