2010-09-16 17:29:14 +00:00
|
|
|
class RequireAdminFlag < ActiveRecord::Migration
|
|
|
|
|
|
|
|
# Make the admin flag required.
|
|
|
|
def self.up
|
|
|
|
# update any existing records
|
2010-09-17 16:12:27 +00:00
|
|
|
Msf::DBManager::User.update_all({:admin => true}, {:admin => nil})
|
2010-09-16 17:29:14 +00:00
|
|
|
|
|
|
|
change_column :users, :admin, :boolean, :null => false, :default => true
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.down
|
|
|
|
change_column :users, :admin, :boolean, :default => true
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|