journalduhacker/db/migrate/20120919195401_private_tags.rb
2012-09-19 20:28:09 -04:00

16 lines
306 B
Ruby

class PrivateTags < ActiveRecord::Migration
def up
add_column :tags, :privileged, :boolean, :default => false
# All existing tags should be public by default
Tag.all.each do |t|
t.privileged = false
t.save
end
end
def down
remove_column :tags, :privileged
end
end