Skip to content

Latest commit

 

History

History
16 lines (13 loc) · 517 Bytes

remove-the-default-value-on-a-column.md

File metadata and controls

16 lines (13 loc) · 517 Bytes

Remove The Default Value On A Column

You have a column on one of your database tables with a default value. You'd like to remove the default value. Removing the default is the same as setting it to nil. You can do this with the ActiveRecord DSL using the change_column_default method.

def change
  change_column_default :users, :age, nil
end

See the docs for more details.