mirror of
https://github.com/rapid7/metasploit-framework
synced 2024-11-12 11:52:01 +01:00
2b891db0e1
instead of one UPDATE per record. git-svn-id: file:///home/svn/framework3/trunk@10348 4d416f70-5f16-0410-b530-b9f4589650da
16 lines
363 B
Ruby
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
|