X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/a0a6dd36190788b89c5d97f981b4e9b563eb385e..ddac660f3b7cc09a7718f20d1b857b0794d5a4ef:/db/migrate/030_add_foreign_keys.rb?ds=sidebyside diff --git a/db/migrate/030_add_foreign_keys.rb b/db/migrate/030_add_foreign_keys.rb index 183aa30db..ed7652543 100644 --- a/db/migrate/030_add_foreign_keys.rb +++ b/db/migrate/030_add_foreign_keys.rb @@ -1,12 +1,14 @@ -class AddForeignKeys < ActiveRecord::Migration +require "migrate" + +class AddForeignKeys < ActiveRecord::Migration[4.2] def self.up - add_foreign_key :changeset_tags, [:id], :changesets - add_foreign_key :diary_comments, [:diary_entry_id], :diary_entries, [:id] - add_foreign_key :gps_points, [:gpx_id], :gpx_files, [:id] - add_foreign_key :gpx_file_tags, [:gpx_id], :gpx_files, [:id] + add_foreign_key :changeset_tags, :changesets, :column => :id, :name => "changeset_tags_id_fkey" + add_foreign_key :diary_comments, :diary_entries, :name => "diary_comments_diary_entry_id_fkey" + add_foreign_key :gps_points, :gpx_files, :column => :gpx_id, :name => "gps_points_gpx_id_fkey" + add_foreign_key :gpx_file_tags, :gpx_files, :column => :gpx_id, :name => "gpx_file_tags_gpx_id_fkey" end def self.down - raise IrreversibleMigration.new + raise ActiveRecord::IrreversibleMigration end end