1
mirror of https://github.com/rapid7/metasploit-framework synced 2024-11-12 11:52:01 +01:00
metasploit-framework/data/sql/migrate/20100916151530_require_admin_flag.rb
Mike Smith 2b891db0e1 Use the fully-qualified name of the User class. Also, use a bulk UPDATE
instead of one UPDATE per record.

git-svn-id: file:///home/svn/framework3/trunk@10348 4d416f70-5f16-0410-b530-b9f4589650da
2010-09-17 16:12:27 +00:00

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