aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXinhui2017-03-20 15:20:31 +0100
committerXinhui2017-03-20 15:20:31 +0100
commitb94059f6d7732eacd2d30f0840a2712f42d2e9e9 (patch)
tree641898b565e440268961d475f7f121d226e77d2d
parentf6b444e426c15bab909f139730814423c6b76c89 (diff)
downloadchouette-core-b94059f6d7732eacd2d30f0840a2712f42d2e9e9.tar.bz2
Fix migration stoppoint_route_fkey of relation stop_points does not exist
-rw-r--r--db/migrate/20170317114614_remove_stop_points_route_fk.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/db/migrate/20170317114614_remove_stop_points_route_fk.rb b/db/migrate/20170317114614_remove_stop_points_route_fk.rb
index 5167df594..ff191445a 100644
--- a/db/migrate/20170317114614_remove_stop_points_route_fk.rb
+++ b/db/migrate/20170317114614_remove_stop_points_route_fk.rb
@@ -1,5 +1,7 @@
class RemoveStopPointsRouteFk < ActiveRecord::Migration
def change
- remove_foreign_key :stop_points, name: :stoppoint_route_fkey
+ if foreign_keys(:stop_points).include?(:stoppoint_route_fkey)
+ remove_foreign_key :stop_points, name: :stoppoint_route_fkey
+ end
end
end