Sha256: 5623a0e0a8d980468d54a00d76e56c7cd8e01a20b5184d9f3d02ae45e097b2a0

Contents?: true

Size: 1.1 KB

Versions: 38

Compression:

Stored size: 1.1 KB

Contents

class CreateJoinTables < ActiveRecord::Migration
  def change
    create_join_table :businesses, :listings
    add_index(:businesses_listings, [:business_id, :listing_id], unique: true)
    add_index(:businesses_listings, :listing_id)

    create_join_table :enumerations, :listings
    add_index(:enumerations_listings, [:enumeration_id, :listing_id], unique: true)
    add_index(:enumerations_listings, :listing_id)

    create_join_table :listing_offices, :listings
    add_index(:listing_offices_listings, [:listing_office_id, :listing_id], unique: true, name: "index_listings_offices_listing_id_office_id")
    add_index(:listing_offices_listings, :listing_id)

    create_join_table :listings, :participants
    add_index(:listings_participants, [:participant_id, :listing_id], unique: true)
    add_index(:listings_participants, :listing_id)

    create_join_table :listings, :places
    add_index(:listings_places, [:listing_id, :place_id], unique: true)
    add_index(:listings_places, :listing_id)

    create_join_table :places, :schools
    add_index(:places_schools, [:place_id, :school_id], unique: true)

  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
reso-0.1.6.7 lib/generators/reso/templates/create_join_tables.rb
reso-0.1.6.6 lib/generators/reso/templates/create_join_tables.rb
reso-0.1.6.5 lib/generators/reso/templates/create_join_tables.rb
reso-0.1.6.4 lib/generators/reso/templates/create_join_tables.rb
reso-0.1.6.3 lib/generators/reso/templates/create_join_tables.rb
reso-0.1.6.2 lib/generators/reso/templates/create_join_tables.rb
reso-0.1.6.1 lib/generators/reso/templates/create_join_tables.rb
reso-0.1.6 lib/generators/reso/templates/create_join_tables.rb
reso-0.1.5.11 lib/generators/reso/templates/create_join_tables.rb
reso-0.1.5.10 lib/generators/reso/templates/create_join_tables.rb
reso-0.1.5.9 lib/generators/reso/templates/create_join_tables.rb
reso-0.1.5.7 lib/generators/reso/templates/create_join_tables.rb
reso-0.1.5.6 lib/generators/reso/templates/create_join_tables.rb
reso-0.1.5.5 lib/generators/reso/templates/create_join_tables.rb
reso-0.1.5.4 lib/generators/reso/templates/create_join_tables.rb
reso-0.1.5.3 lib/generators/reso/templates/create_join_tables.rb
reso-0.1.5.2 lib/generators/reso/templates/create_join_tables.rb
reso-0.1.5.1 lib/generators/reso/templates/create_join_tables.rb
reso-0.1.5.0 lib/generators/reso/templates/create_join_tables.rb
reso-0.1.4.10 lib/generators/reso/templates/create_join_tables.rb