Sha256: 647ce361120c3597e7243884bf1b02b53c4e8b996c3cf48d1c321608f4696891

Contents?: true

Size: 674 Bytes

Versions: 11

Compression:

Stored size: 674 Bytes

Contents

# encoding: UTF-8
class AddUniqueIndicies < ActiveRecord::Migration
  def self.up
    remove_index(:response_sets, :name => 'response_sets_ac_idx')
    add_index(:response_sets, :access_code, :name => 'response_sets_ac_idx', :unique => true)

    remove_index(:surveys, :name => 'surveys_ac_idx')
    add_index(:surveys, :access_code, :name => 'surveys_ac_idx', :unique => true)
  end

  def self.down
    remove_index(:response_sets, :name => 'response_sets_ac_idx')
    add_index(:response_sets, :access_code, :name => 'response_sets_ac_idx')

    remove_index(:surveys, :name => 'surveys_ac_idx')
    add_index(:surveys, :access_code, :name => 'surveys_ac_idx')
  end
end

Version data entries

11 entries across 11 versions & 4 rubygems

Version Path
upgrade_surveyor-1.4.2 lib/generators/surveyor/templates/db/migrate/add_unique_indicies.rb
affectiva-surveyor-1.5.0.pre.disco.2 lib/generators/surveyor/templates/db/migrate/add_unique_indicies.rb
hssc_surveyor-1.4.3.pre lib/generators/surveyor/templates/db/migrate/add_unique_indicies.rb
hssc_surveyor-1.4.2.pre lib/generators/surveyor/templates/db/migrate/add_unique_indicies.rb
hssc_surveyor-1.4.1.pre lib/generators/surveyor/templates/db/migrate/add_unique_indicies.rb
surveyor-1.4.0 lib/generators/surveyor/templates/db/migrate/add_unique_indicies.rb
surveyor-1.3.0 lib/generators/surveyor/templates/db/migrate/add_unique_indicies.rb
surveyor-1.2.0 lib/generators/surveyor/templates/db/migrate/add_unique_indicies.rb
surveyor-1.1.0 lib/generators/surveyor/templates/db/migrate/add_unique_indicies.rb
surveyor-1.0.1 lib/generators/surveyor/templates/db/migrate/add_unique_indicies.rb
surveyor-1.0.0 lib/generators/surveyor/templates/db/migrate/add_unique_indicies.rb