Sha256: 2363530ef9c032ee39748e51e22c3cd4465b2cddf906cd4eefde36b8e866c119

Contents?: true

Size: 771 Bytes

Versions: 5

Compression:

Stored size: 771 Bytes

Contents

class UpdateFactNamesAndValuesToBin < 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_names MODIFY name varchar(255) COLLATE utf8_bin NOT NULL}
      execute %{ALTER TABLE fact_values MODIFY value varchar(255) 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_names MODIFY name varchar(255)}
      execute %{ALTER TABLE fact_values MODIFY value varchar(255)}
    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/20100325142616_update_fact_names_and_values_to_bin.rb
foreman_discovery-1.0.0.rc4 test/foreman_app/db/migrate/20100325142616_update_fact_names_and_values_to_bin.rb
foreman_discovery-1.0.0.rc3 test/foreman_app/db/migrate/20100325142616_update_fact_names_and_values_to_bin.rb
foreman_discovery-1.0.0.rc2 test/foreman_app/db/migrate/20100325142616_update_fact_names_and_values_to_bin.rb
foreman_discovery-1.0.0.rc1 test/foreman_app/db/migrate/20100325142616_update_fact_names_and_values_to_bin.rb