1
0
mirror of https://github.com/meineerde/redmine.git synced 2026-03-14 13:08:14 +00:00
redmine/time/db/migrate/020_add_role_position.rb
Jean-Philippe Lang b23cb49756 created branch for time tracking
git-svn-id: http://redmine.rubyforge.org/svn/branches/work@330 e93f8b46-1217-0410-a6f0-8f06a7374b81
2007-03-11 18:11:40 +00:00

11 lines
291 B
Ruby

class AddRolePosition < ActiveRecord::Migration
def self.up
add_column :roles, :position, :integer, :default => 1, :null => false
Role.find(:all).each_with_index {|role, i| role.update_attribute(:position, i+1)}
end
def self.down
remove_column :roles, :position
end
end