X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/14ac1babc2517320a2c90fa9b4ac36a5a6e68018..2c7bc3649367bb7f1f75e8ed78c50464645b87cc:/db/migrate/20140519141742_add_join_table_between_users_and_changesets.rb diff --git a/db/migrate/20140519141742_add_join_table_between_users_and_changesets.rb b/db/migrate/20140519141742_add_join_table_between_users_and_changesets.rb index 37ec1a220..a5cfabd69 100644 --- a/db/migrate/20140519141742_add_join_table_between_users_and_changesets.rb +++ b/db/migrate/20140519141742_add_join_table_between_users_and_changesets.rb @@ -1,13 +1,16 @@ -require 'migrate' -class AddJoinTableBetweenUsersAndChangesets < ActiveRecord::Migration +require "migrate" + +class AddJoinTableBetweenUsersAndChangesets < ActiveRecord::Migration[5.0] def change - create_table :changesets_subscribers, id: false do |t| - t.column :subscriber_id, :bigint, null: false - t.column :changeset_id, :bigint, null: false + create_table :changesets_subscribers, :id => false do |t| + t.column :subscriber_id, :bigint, :null => false + t.column :changeset_id, :bigint, :null => false end - add_foreign_key :changesets_subscribers, [:subscriber_id], :users, [:id] - add_foreign_key :changesets_subscribers, [:changeset_id], :changesets, [:id] - add_index :changesets_subscribers, [:subscriber_id, :changeset_id], { :unique => true } + + add_foreign_key :changesets_subscribers, :users, :column => :subscriber_id, :name => "changesets_subscribers_subscriber_id_fkey" + add_foreign_key :changesets_subscribers, :changesets, :name => "changesets_subscribers_changeset_id_fkey" + + add_index :changesets_subscribers, [:subscriber_id, :changeset_id], :unique => true add_index :changesets_subscribers, [:changeset_id] end end