openstreetmap-website/db/migrate/20110322001319_add_terms_seen_to_user.rb
2019-11-27 11:47:16 +00:00

16 lines
439 B
Ruby

class AddTermsSeenToUser < ActiveRecord::Migration[4.2]
class User < ApplicationRecord
end
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