Skip to content

Commit 9b4ee46

Browse files
armandmgtpirj
andauthored
Apply suggestions from code review
Co-authored-by: Phil Pirozhkov <pirj@users.noreply.github.com>
1 parent 712c833 commit 9b4ee46

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

README.adoc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,14 +1183,16 @@ create_table :users do |t|
11831183
t.boolean :active
11841184
end
11851185
1186-
# bad - adding a boolean without a `NOT NULL` constraint or without a default value
1186+
# bad - adding a boolean column without a `NOT NULL` constraint or without a default value to an existing table
11871187
add_column :users, :active, :boolean
11881188
add_column :users, :active, :boolean, null: false
11891189
1190-
# good - boolean with a `NOT NULL` constraint, and a default value (`false` or `true`) for existing tables
1190+
# good - boolean column with a `NOT NULL` constraint for new tables
11911191
create_table :users do |t|
11921192
t.boolean :active, null: false
11931193
end
1194+
1195+
# good - boolean column with a `NOT NULL` constraint, and a default value (`false` or `true`) for existing tables
11941196
add_column :users, :active, :boolean, default: true, null: false
11951197
add_column :users, :admin, :boolean, default: false, null: false
11961198
----

0 commit comments

Comments
 (0)