metasploit-framework/data/sql/migrate/20100916151530_require_admi...

16 lines
363 B
Ruby

class RequireAdminFlag < ActiveRecord::Migration
# Make the admin flag required.
def self.up
# update any existing records
Msf::DBManager::User.update_all({:admin => true}, {:admin => nil})
change_column :users, :admin, :boolean, :null => false, :default => true
end
def self.down
change_column :users, :admin, :boolean, :default => true
end
end