Sha256: fa81aa7ad0b0808f02c7094645c4858558140fde1c2d3186935f087919832437

Contents?: true

Size: 641 Bytes

Versions: 5

Compression:

Stored size: 641 Bytes

Contents

class RevertFaceNamesAndValuesToTextRecords < ActiveRecord::Migration
  def self.up
    if ActiveRecord::Base.connection.instance_values["config"][:adapter] == "mysql" or ActiveRecord::Base.connection.instance_values["config"][:adapter] == "mysql2"
      execute "ALTER TABLE fact_values MODIFY value text COLLATE utf8_bin NOT NULL;"
    end
  end

  def self.down
    if ActiveRecord::Base.connection.instance_values["config"][:adapter] == "mysql" or ActiveRecord::Base.connection.instance_values["config"][:adapter] == "mysql2"
      execute %{ALTER TABLE fact_values MODIFY value varchar(255) COLLATE utf8_bin NOT NULL}
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
foreman_discovery-1.0.0 test/foreman_app/db/migrate/20110321070954_revert_face_names_and_values_to_text_records.rb
foreman_discovery-1.0.0.rc4 test/foreman_app/db/migrate/20110321070954_revert_face_names_and_values_to_text_records.rb
foreman_discovery-1.0.0.rc3 test/foreman_app/db/migrate/20110321070954_revert_face_names_and_values_to_text_records.rb
foreman_discovery-1.0.0.rc2 test/foreman_app/db/migrate/20110321070954_revert_face_names_and_values_to_text_records.rb
foreman_discovery-1.0.0.rc1 test/foreman_app/db/migrate/20110321070954_revert_face_names_and_values_to_text_records.rb