avram
avram copied to clipboard
remove_belongs_to throws error about fk constraint
When you want to remove a belongs_to, postgres will throw an error like:
cannot drop column whatever because other objects depend on it
This is due to the foreign constraint keys. I think when we add remove_belongs_to, we need to also run something like:
execute <<-SQL
ALTER TABLE things
DROP CONSTRAINT things_whatever_id_fkey
SQL