X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/869da5e2287989da77da203e8c60442b96e5cef3..e4d7b3ee6631e1c5aee23ebe52adb32c716f5cbd:/lib/migrate.rb diff --git a/lib/migrate.rb b/lib/migrate.rb index 05b3c90f2..50ba6321d 100644 --- a/lib/migrate.rb +++ b/lib/migrate.rb @@ -21,6 +21,11 @@ module ActiveRecord "REFERENCES #{reftbl} (#{quote_column_names(refcol || column_name)})" end + def remove_foreign_key(table_name, column_name, reftbl, refcol = nil) + execute "ALTER TABLE #{table_name} DROP " + + "CONSTRAINT #{table_name}_#{column_name[0]}_fkey" + end + alias_method :old_options_include_default?, :options_include_default? def options_include_default?(options)