I am currently trying to perform this migration:
class AddDroppedProjectsCountToUser < ActiveRecord::Migration def self.up add_column :users, :dropped_projects, :integer, {:default=>0, :required=>true} end def self.down remove_column :users, :dropped_projects end end
The column was added correctly, but none of the old entries are filled with 0. They are zero. I tried using default=>'0' , but to no avail. Any idea why this might happen? (Rails 3.0.3)
Edited to add: when I create a new user, it works fine, and everything looks right. These are just old users who still have zero for this value in the table.
sql ruby-on-rails postgresql ruby-on-rails-3
Dave g
source share