Ruby on Rails Monday, July 10, 2017

That statement you pasted defines it, it's stored as a function in postgres. See https://www.postgresql.org/docs/9.5/static/xfunc-sql.html for docs on how this works in postgres.

July 10, 2017 at 2:36 PM via Postbox
My question, if this is my migration:

migration.rb
def change

connection.execute <<-SQL
CREATE OR REPLACE FUNCTION john_uuid_generator() RETURNS uuid
AS $$ SELECT * FROM #{uuid_function} $$
LANGUAGE SQL VOLATILE;
SQL

end


Where do I define john_uuid_generator()?

Thanks!



--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAKNtY_x1qm_VXqcUdMXQ8pytHQF2tFuLAmgnv%2Bvf-8uZGXBMqw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


--
Matt

No comments:

Post a Comment