end
def self.down
- raise IrreversibleMigration.new
+ remove_foreign_key :diary_entries, [:language_code], :languages, [:code]
+ remove_foreign_key :users, [:locale], :languages, [:code]
+
+ drop_table :languages
end
end
"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)