cirandas.net

ref: master

plugins/suppliers/db/migrate/20160805142332_add_profile_fields_to_suppliers.rb


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
class AddProfileFieldsToSuppliers < ActiveRecord::Migration
  def change
    remove_column :suppliers_plugin_suppliers, :use_geolocalization, :boolean
    remove_column :suppliers_plugin_suppliers, :use_contact, :boolean
    remove_column :suppliers_plugin_suppliers, :use_registry, :boolean
    remove_column :suppliers_plugin_suppliers, :use_strategic_info, :boolean
    add_column :suppliers_plugin_suppliers, :phone, :string
    add_column :suppliers_plugin_suppliers, :cell_phone, :string
    add_column :suppliers_plugin_suppliers, :email, :string
    add_column :suppliers_plugin_suppliers, :hub_id, :integer
    add_column :suppliers_plugin_suppliers, :address, :string
    add_column :suppliers_plugin_suppliers, :city, :string
    add_column :suppliers_plugin_suppliers, :state, :string
    add_column :suppliers_plugin_suppliers, :zip, :string
    add_index  :suppliers_plugin_suppliers, :hub_id
  end
end