Sha256: a52e9ed304615409f3020635ebdd05e7be52ee5708135a0c788214c686ca8a39

Contents?: true

Size: 392 Bytes

Versions: 16

Compression:

Stored size: 392 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

16 entries across 16 versions & 1 rubygems

Version Path
fat_free_crm-0.13.6 db/migrate/20120224073107_remove_default_value_and_clear_settings.rb
fat_free_crm-0.13.5 db/migrate/20120224073107_remove_default_value_and_clear_settings.rb
fat_free_crm-0.13.4 db/migrate/20120224073107_remove_default_value_and_clear_settings.rb
fat_free_crm-0.13.3 db/migrate/20120224073107_remove_default_value_and_clear_settings.rb
fat_free_crm-0.13.2 db/migrate/20120224073107_remove_default_value_and_clear_settings.rb
fat_free_crm-0.12.3 db/migrate/20120224073107_remove_default_value_and_clear_settings.rb
fat_free_crm-0.12.2 db/migrate/20120224073107_remove_default_value_and_clear_settings.rb
fat_free_crm-0.13.1 db/migrate/20120224073107_remove_default_value_and_clear_settings.rb
fat_free_crm-0.12.1 db/migrate/20120224073107_remove_default_value_and_clear_settings.rb
fat_free_crm-0.13.0 db/migrate/20120224073107_remove_default_value_and_clear_settings.rb
fat_free_crm-0.12.0 db/migrate/20120224073107_remove_default_value_and_clear_settings.rb
fat_free_crm-0.11.4 db/migrate/20120224073107_remove_default_value_and_clear_settings.rb
fat_free_crm-0.11.3 db/migrate/20120224073107_remove_default_value_and_clear_settings.rb
fat_free_crm-0.11.2 db/migrate/20120224073107_remove_default_value_and_clear_settings.rb
fat_free_crm-0.11.1 db/migrate/20120224073107_remove_default_value_and_clear_settings.rb
fat_free_crm-0.11.0 db/migrate/20120224073107_remove_default_value_and_clear_settings.rb