Sha256: 1502274fd62ea8c7de8fa8c23bbc5b93fe18b2d7af969771b7a6af9a849abd2d

Contents?: true

Size: 1 KB

Versions: 36

Compression:

Stored size: 1 KB

Contents

class CreateAddresses < ActiveRecord::Migration
  def change
    create_table :addresses, options: 'DEFAULT CHARSET=utf8' do |t|
      t.string :addressable_type
      t.references :addressable, index: true

      t.integer :preference_order, default: 1 
      t.integer :address_preference_order, default: 1
      t.string :full_street_address
      t.integer :street_number, limit: 8
      t.string :street_dir_prefix
      t.string :street_name
      t.string :street_suffix
      t.string :street_dir_suffix
      t.string :street_additional_info
      t.integer :box_number
      t.string :unit_number
      t.string :city
      t.string :state_or_province
      t.string :postal_code
      t.string :carrier_route
      t.string :country, default: "US"
      t.references :address_type

      t.timestamps
    end
    add_index :addresses, :city
    add_index :addresses, :state_or_province
    add_index :addresses, :postal_code
    add_index :addresses, :country
    add_index :addresses, :addressable_type
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
reso-0.1.4.9 lib/generators/reso/templates/create_addresses.rb
reso-0.1.4.8 lib/generators/reso/templates/create_addresses.rb
reso-0.1.4.7 lib/generators/reso/templates/create_addresses.rb
reso-0.1.4.6 lib/generators/reso/templates/create_addresses.rb
reso-0.1.4.5 lib/generators/reso/templates/create_addresses.rb
reso-0.1.4.4 lib/generators/reso/templates/create_addresses.rb
reso-0.1.4.3 lib/generators/reso/templates/create_addresses.rb
reso-0.1.4.2 lib/generators/reso/templates/create_addresses.rb
reso-0.1.4.1 lib/generators/reso/templates/create_addresses.rb
reso-0.1.4.0 lib/generators/reso/templates/create_addresses.rb
reso-0.1.3.1 lib/generators/reso/templates/create_addresses.rb
reso-0.1.3.0 lib/generators/reso/templates/create_addresses.rb
reso-0.1.2.0 lib/generators/reso/templates/create_addresses.rb
reso-0.1.1.0 lib/generators/reso/templates/create_addresses.rb
reso-0.1.0.3 lib/generators/reso/templates/create_addresses.rb
reso-0.1.0.2 lib/generators/reso/templates/create_addresses.rb