Sha256: e4e21ce0a0a469786ed190028e0a5a8f90069ca5cfe302a3ffd2539ca2cf6b91

Contents?: true

Size: 563 Bytes

Versions: 5

Compression:

Stored size: 563 Bytes

Contents

class ChangeMysqlReportsColumn < 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 reports MODIFY log mediumtext;"
    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 reports MODIFY log text;"
    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/20100115021803_change_mysql_reports_column.rb
foreman_discovery-1.0.0.rc4 test/foreman_app/db/migrate/20100115021803_change_mysql_reports_column.rb
foreman_discovery-1.0.0.rc3 test/foreman_app/db/migrate/20100115021803_change_mysql_reports_column.rb
foreman_discovery-1.0.0.rc2 test/foreman_app/db/migrate/20100115021803_change_mysql_reports_column.rb
foreman_discovery-1.0.0.rc1 test/foreman_app/db/migrate/20100115021803_change_mysql_reports_column.rb