alex3t / rails_on_pg Goto Github PK
View Code? Open in Web Editor NEWPostgreSQL views, functions, triggers, foreign keys for rails migration
PostgreSQL views, functions, triggers, foreign keys for rails migration
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.
The install command should be changed in the ext file to:
rails plugin install
I believe that with Rails 3.0 the scritp/ commands became outdated.
Best and thanks for this useful plugin.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.