Skip to content

Commit

Permalink
Merge 146a517 into 90def2a
Browse files Browse the repository at this point in the history
  • Loading branch information
garethrees committed Mar 13, 2024
2 parents 90def2a + 146a517 commit d68191c
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/models/censor_rule.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# == Schema Information
# Schema version: 20210114161442
# Schema version: 20240313094449
#
# Table name: censor_rules
#
Expand All @@ -13,7 +13,7 @@
# last_edit_comment :text not null
# created_at :datetime not null
# updated_at :datetime not null
# regexp :boolean
# regexp :boolean default(FALSE), not null
#

# models/censor_rule.rb:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
class AddNotNullConstraintToCensorRuleRegexp < ActiveRecord::Migration[7.0]
def up
change_column_default :censor_rules, :regexp, false
CensorRule.where(regexp: nil).update_all(regexp: false)
change_column_null :censor_rules, :regexp, false
end

def down
change_column_null :censor_rules, :regexp, true
change_column_default :censor_rules, :regexp, nil
end
end
1 change: 1 addition & 0 deletions doc/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Highlighted Features

* Add default value and not null constraint to `CensorRule#regexp` (Gareth Rees)
* Reduce amount of storage related background jobs (Graeme Porteous)
* Add automatic parsing of emails contain Excel spreadsheets (Graeme Porteous)
* Improve rendering of admin hidden request prominence and explanations (Graeme
Expand Down
4 changes: 2 additions & 2 deletions spec/factories/censor_rules.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# == Schema Information
# Schema version: 20210114161442
# Schema version: 20240313094449
#
# Table name: censor_rules
#
Expand All @@ -13,7 +13,7 @@
# last_edit_comment :text not null
# created_at :datetime not null
# updated_at :datetime not null
# regexp :boolean
# regexp :boolean default(FALSE), not null
#

FactoryBot.define do
Expand Down
4 changes: 2 additions & 2 deletions spec/models/censor_rule_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# == Schema Information
# Schema version: 20210114161442
# Schema version: 20240313094449
#
# Table name: censor_rules
#
Expand All @@ -13,7 +13,7 @@
# last_edit_comment :text not null
# created_at :datetime not null
# updated_at :datetime not null
# regexp :boolean
# regexp :boolean default(FALSE), not null
#

require 'spec_helper'
Expand Down

0 comments on commit d68191c

Please sign in to comment.