Hi,
first, thanks for giving us this nice plugin !
I'm using rails_on_pg in my project and I run into this issue when I try a migration :
When I want to add a funcion, rails_on_pg automatically add a "CREATE LANGUAGE plpgsql" statement before. But if this language has already been created (e.g : by another create_function call before this one), I get an ActiveRecord::StatementInvalid wich cause the transaction to rollback when running rake db:migrate. Though the plugin uses rescue ActiveRecord::StatementInvalid when executing this create language statement.
Note that while using rake db:setup (which is 'db:create', 'db:schema:load', 'db:seed') we don't have the problem since the StatementInvalid is catched in the rescue in this case.
I'm not so familiar with rails migration mechanism so I'm stuck after reaching this point in debugging :/
Hi, first, thanks for giving us this nice plugin ! I'm using rails_on_pg in my project and I run into this issue when I try a migration :
When I want to add a funcion, rails_on_pg automatically add a "CREATE LANGUAGE plpgsql" statement before. But if this language has already been created (e.g : by another create_function call before this one), I get an ActiveRecord::StatementInvalid wich cause the transaction to rollback when running rake db:migrate. Though the plugin uses rescue ActiveRecord::StatementInvalid when executing this create language statement.
Note that while using rake db:setup (which is 'db:create', 'db:schema:load', 'db:seed') we don't have the problem since the StatementInvalid is catched in the rescue in this case.
I'm not so familiar with rails migration mechanism so I'm stuck after reaching this point in debugging :/
I put a sample project to test this behavior here : http://github.com/gonzoyumo/rails_on_pg_test Complete workflow explained in the readme.
I will appreciate your help to solve this issue.
gonzoyumo.