Sha256: 7d12240778925b1615b02a5ce43c805ade348119332b0731d9cf28bae8550857

Contents?: true

Size: 611 Bytes

Versions: 26

Compression:

Stored size: 611 Bytes

Contents

# Changes index on address so it scoped to workspace_id and is unique to match the validation in {Mdm::Host} on
# {Mdm::Host#address}.
class EnforceAddressUniquenessInWorkspaceInHosts < ActiveRecord::Migration
  TABLE_NAME = :hosts

  # Restores old index on address
  def down
    change_table TABLE_NAME do |t|
      t.remove_index [:workspace_id, :address]

      t.index :address
    end
  end

  # Make index on address scope to workspace_id and be unique
  def up
    change_table TABLE_NAME do |t|
      t.remove_index :address

      t.index [:workspace_id, :address], :unique => true
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
metasploit_data_models-0.16.4-java db/migrate/20130430162145_enforce_address_uniqueness_in_workspace_in_hosts.rb
metasploit_data_models-0.16.4 db/migrate/20130430162145_enforce_address_uniqueness_in_workspace_in_hosts.rb
metasploit_data_models-0.16.3-java db/migrate/20130430162145_enforce_address_uniqueness_in_workspace_in_hosts.rb
metasploit_data_models-0.16.1-java db/migrate/20130430162145_enforce_address_uniqueness_in_workspace_in_hosts.rb
metasploit_data_models-0.16.1 db/migrate/20130430162145_enforce_address_uniqueness_in_workspace_in_hosts.rb
metasploit_data_models-0.16.0-java db/migrate/20130430162145_enforce_address_uniqueness_in_workspace_in_hosts.rb
metasploit_data_models-0.16.0 db/migrate/20130430162145_enforce_address_uniqueness_in_workspace_in_hosts.rb
metasploit_data_models-0.15.2-java db/migrate/20130430162145_enforce_address_uniqueness_in_workspace_in_hosts.rb
metasploit_data_models-0.15.2 db/migrate/20130430162145_enforce_address_uniqueness_in_workspace_in_hosts.rb
metasploit_data_models-0.15.1-java db/migrate/20130430162145_enforce_address_uniqueness_in_workspace_in_hosts.rb
metasploit_data_models-0.15.1 db/migrate/20130430162145_enforce_address_uniqueness_in_workspace_in_hosts.rb
metasploit_data_models-0.15.0 db/migrate/20130430162145_enforce_address_uniqueness_in_workspace_in_hosts.rb
metasploit_data_models-0.14.4-java db/migrate/20130430162145_enforce_address_uniqueness_in_workspace_in_hosts.rb
metasploit_data_models-0.14.4 db/migrate/20130430162145_enforce_address_uniqueness_in_workspace_in_hosts.rb
metasploit_data_models-0.14.3-java db/migrate/20130430162145_enforce_address_uniqueness_in_workspace_in_hosts.rb
metasploit_data_models-0.14.3 db/migrate/20130430162145_enforce_address_uniqueness_in_workspace_in_hosts.rb
metasploit_data_models-0.14.2-java db/migrate/20130430162145_enforce_address_uniqueness_in_workspace_in_hosts.rb
metasploit_data_models-0.14.2 db/migrate/20130430162145_enforce_address_uniqueness_in_workspace_in_hosts.rb
metasploit_data_models-0.14.1-java db/migrate/20130430162145_enforce_address_uniqueness_in_workspace_in_hosts.rb
metasploit_data_models-0.14.1 db/migrate/20130430162145_enforce_address_uniqueness_in_workspace_in_hosts.rb