openstreetmap-website/db/migrate/20110322001319_add_terms_seen_to_user.rb
2015-02-20 08:56:16 +00:00

13 lines
394 B
Ruby

class AddTermsSeenToUser < ActiveRecord::Migration
def self.up
add_column :users, :terms_seen, :boolean, :null => false, :default => false
# best guess available is just that everyone who has agreed has
# seen the terms, and that noone else has.
User.update_all "terms_seen = (terms_agreed is not null)"
end
def self.down
remove_column :users, :terms_seen
end
end