Sha256: 46a038c9094616383a9247e868d6b009c37b1028fa8db617a3d1cb19bb7983e6

Contents?: true

Size: 352 Bytes

Versions: 127

Compression:

Stored size: 352 Bytes

Contents

class RequireAdminFlag < ActiveRecord::Migration

	# Make the admin flag required.
	def self.up
		# update any existing records
		Mdm::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

Version data entries

127 entries across 127 versions & 1 rubygems

Version Path
metasploit_data_models-1.2.11 db/migrate/20100916151530_require_admin_flag.rb
metasploit_data_models-1.2.10 db/migrate/20100916151530_require_admin_flag.rb
metasploit_data_models-1.2.9 db/migrate/20100916151530_require_admin_flag.rb
metasploit_data_models-1.2.8 db/migrate/20100916151530_require_admin_flag.rb
metasploit_data_models-1.2.7 db/migrate/20100916151530_require_admin_flag.rb
metasploit_data_models-1.2.6 db/migrate/20100916151530_require_admin_flag.rb
metasploit_data_models-1.2.5 db/migrate/20100916151530_require_admin_flag.rb
metasploit_data_models-1.2.4 db/migrate/20100916151530_require_admin_flag.rb
metasploit_data_models-1.2.3 db/migrate/20100916151530_require_admin_flag.rb
metasploit_data_models-1.2.2 db/migrate/20100916151530_require_admin_flag.rb
metasploit_data_models-0.24.5 db/migrate/20100916151530_require_admin_flag.rb
metasploit_data_models-0.24.4 db/migrate/20100916151530_require_admin_flag.rb
metasploit_data_models-1.2.1 db/migrate/20100916151530_require_admin_flag.rb
metasploit_data_models-1.2.0 db/migrate/20100916151530_require_admin_flag.rb
metasploit_data_models-1.1.0 db/migrate/20100916151530_require_admin_flag.rb
metasploit_data_models-1.0.1 db/migrate/20100916151530_require_admin_flag.rb
metasploit_data_models-1.0.0 db/migrate/20100916151530_require_admin_flag.rb
metasploit_data_models-0.24.3 db/migrate/20100916151530_require_admin_flag.rb
metasploit_data_models-0.24.2 db/migrate/20100916151530_require_admin_flag.rb
metasploit_data_models-0.24.1.pre.rspec.pre.3.pre.1 db/migrate/20100916151530_require_admin_flag.rb