X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/82db7eccc8857081316469d7eb242f422332f097..8b12abd5bb1b96567ab882a3aca0780d0e4af67a:/db/migrate/20110322001319_add_terms_seen_to_user.rb diff --git a/db/migrate/20110322001319_add_terms_seen_to_user.rb b/db/migrate/20110322001319_add_terms_seen_to_user.rb new file mode 100644 index 000000000..8178c1592 --- /dev/null +++ b/db/migrate/20110322001319_add_terms_seen_to_user.rb @@ -0,0 +1,13 @@ +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