X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/6c66507427961a22a8f282b5b2f4ab7fda1dad6f..6f9609f7bdd9c754b62fd0c1022f177a3ab709db:/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)