Skip to content

Commit

Permalink
Add trust_level_locked column
Browse files Browse the repository at this point in the history
  • Loading branch information
riking authored and SamSaffron committed Sep 30, 2014
1 parent a7a1dca commit e69d084
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions db/migrate/20140913192733_add_trust_level_locked_column.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
class AddTrustLevelLockedColumn < ActiveRecord::Migration
def change
add_column :users, :trust_level_locked, :boolean, { default: false, null: false}

reversible do |dir|
dir.up do
# Populate the column
execute <<-SQL
UPDATE users
SET trust_level_locked = 't'
WHERE trust_level = 4
SQL
end
dir.down do
# column is removed, no need to fill it
end
end
end
end

0 comments on commit e69d084

Please sign in to comment.