X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/a3eb48385bcf1465339d473c0c1657e075cd507d..77e8a16a153752b919a9153c1c9ded9834d387f7:/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 d07c6aae9..4eab95ce7 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,14 +1,14 @@ -require 'migrate' +require "migrate" class AddJoinTableBetweenUsersAndChangesets < ActiveRecord::Migration 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_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]