Skip to content

Commit

Permalink
Add NOT NULL constraint to application_paused field on pets (rubyforg…
Browse files Browse the repository at this point in the history
  • Loading branch information
coalest authored Oct 8, 2024
1 parent 58f8fe2 commit c536b22
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/models/pet.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Table name: pets
#
# id :bigint not null, primary key
# application_paused :boolean default(FALSE)
# application_paused :boolean default(FALSE), not null
# birth_date :datetime not null
# breed :string
# description :text
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class AddApplicationPausedNotNullConstraintToPets < ActiveRecord::Migration[7.2]
def change
# Add NOT NULL constraint to application_paused column and update any current NULL values to false
safety_assured do
change_column_null :pets, :application_paused, false, false
end
end
end
4 changes: 2 additions & 2 deletions db/schema.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c536b22

Please sign in to comment.