Sha256: 3c1e3220560f5d714a8fed0581bf803c0cd79b13700c34377bdf2e16b12d304f

Contents?: true

Size: 841 Bytes

Versions: 44

Compression:

Stored size: 841 Bytes

Contents

class AddWorkspaces < ActiveRecord::Migration

	def self.up
		create_table :workspaces do |t|
			t.string    :name
			t.timestamps null: false
		end

		change_table :hosts do |t|
			t.integer   :workspace_id, :required => true
		end

		remove_index :hosts, :column => :address

		#
		# This was broken after 018_add_workspace_user_info was introduced
		# because of the new boundary column.  For some reason, the
		# find_or_create_by_name that .default eventually calls here tries to
		# create a record with the boundary field that doesn't exist yet.
		# See #1724
		#
		#w = Msf::DBManager::Workspace.default
		#Msf::DBManager::Host.update_all ["workspace_id = ?", w.id]
	end

	def self.down
		drop_table :workspaces

		change_table :hosts do |t|
			t.remove   :workspace_id
		end

		add_index :hosts, :address, :unique => true
	end

end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
metasploit_data_models-3.0.10 db/migrate/002_add_workspaces.rb
metasploit_data_models-3.0.9 db/migrate/002_add_workspaces.rb
metasploit_data_models-3.0.8 db/migrate/002_add_workspaces.rb
metasploit_data_models-3.0.7 db/migrate/002_add_workspaces.rb
metasploit_data_models-3.0.6 db/migrate/002_add_workspaces.rb
metasploit_data_models-3.0.5 db/migrate/002_add_workspaces.rb
metasploit_data_models-2.0.17 db/migrate/002_add_workspaces.rb
metasploit_data_models-3.0.4 db/migrate/002_add_workspaces.rb
metasploit_data_models-3.0.2 db/migrate/002_add_workspaces.rb
metasploit_data_models-3.0.1 db/migrate/002_add_workspaces.rb
metasploit_data_models-3.0.0 db/migrate/002_add_workspaces.rb
metasploit_data_models-2.0.16 db/migrate/002_add_workspaces.rb
metasploit_data_models-2.0.15 db/migrate/002_add_workspaces.rb
metasploit_data_models-2.0.14 db/migrate/002_add_workspaces.rb
metasploit_data_models-2.0.13 db/migrate/002_add_workspaces.rb
metasploit_data_models-2.0.12 db/migrate/002_add_workspaces.rb
metasploit_data_models-2.0.11 db/migrate/002_add_workspaces.rb
metasploit_data_models-2.0.10 db/migrate/002_add_workspaces.rb
metasploit_data_models-2.0.9 db/migrate/002_add_workspaces.rb
metasploit_data_models-2.0.8 db/migrate/002_add_workspaces.rb