Sha256: 3eb391f3738db062ce6af5b649527fd37ac33a79055ed2e8e2daf840886664ad

Contents?: true

Size: 925 Bytes

Versions: 2

Compression:

Stored size: 925 Bytes

Contents

class AddAmenities < ActiveRecord::Migration
  def change
    create_table :g5_updatable_hub_amenities do |t|
      t.integer :external_id
      t.string :name
      t.string :icon
      t.timestamp :external_updated_at
      t.timestamp :external_created_at
      t.timestamps
    end

    add_index :g5_updatable_hub_amenities, :external_id, unique: true

    create_table :g5_updatable_hub_amenities_locations do |t|
      t.belongs_to :g5_updatable_hub_amenity
      t.belongs_to :g5_updatable_location
    end

    add_index :g5_updatable_hub_amenities_locations, :g5_updatable_hub_amenity_id, name: 'updatable_amenities_loc_amen_id'
    add_index :g5_updatable_hub_amenities_locations, :g5_updatable_location_id, name: 'updatable_amenities_loc_loc_id'

    # we need this for queries that require a location to have ALL amenities in a list
    add_column :g5_updatable_locations, :flat_amenity_names, :string
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
g5_authenticatable-0.9.1.pre.2 spec/dummy/db/migrate/20161122070749_add_amenities.rb
g5_updatable-0.20.3.pre.1 db/migrate/20161122070749_add_amenities.rb