Displaying 1 result from an estimated 1 matches for "adddeletedattoopt".
2008 Feb 13
4
Migration Issues: Can't update newly added column values
...e
t.boolean :is_deleted, :default => false, :null => false
t.timestamps
end
end
def self.down
drop_table :options
end
end
----------
bugtest/db/migrate/002_add_deleted_at_to_options.rb <--- Upgrade
migration that doesn''t completely work
----------
class AddDeletedAtToOptions < ActiveRecord::Migration
# Create temp model to use...
class Option < ActiveRecord::Base; end
#
# Add `deleted_at` column, set to Time.now if `is_deleted` is true,
# then remove `is_deleted`:
#
def self.up
add_column(:options, :deleted_at, :timestamp, :default => n...