Sha256: d64ccdcb5600bbf02375b9ce73af9649a70c7914de7fd2c47b083015ada66a82

Contents?: true

Size: 390 Bytes

Versions: 6

Compression:

Stored size: 390 Bytes

Contents

class RemoveDefaultValueAndClearSettings < ActiveRecord::Migration
  def up
    remove_column :settings, :default_value

    # Truncate settings table
    if connection.adapter_name.downcase == "sqlite"
      execute("DELETE FROM settings")
    else # mysql and postgres
      execute("TRUNCATE settings")
    end
  end

  def down
    add_column :settings, :default_value, :text
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
fat_free_crm-0.14.2 db/migrate/20120224073107_remove_default_value_and_clear_settings.rb
fat_free_crm-0.14.1 db/migrate/20120224073107_remove_default_value_and_clear_settings.rb
fat_free_crm-0.15.0.beta db/migrate/20120224073107_remove_default_value_and_clear_settings.rb
fat_free_crm-0.14.0 db/migrate/20120224073107_remove_default_value_and_clear_settings.rb
reduced_fat_crm-0.15.0.beta db/migrate/20120224073107_remove_default_value_and_clear_settings.rb
reduced_fat_crm-0.14.0 db/migrate/20120224073107_remove_default_value_and_clear_settings.rb