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