Skip to content

Instantly share code, notes, and snippets.

@hakanensari
Created April 30, 2013 23:47
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save hakanensari/5492772 to your computer and use it in GitHub Desktop.
Save hakanensari/5492772 to your computer and use it in GitHub Desktop.
Sequel + uuid-ossp
Sequel.migration do
up do
run 'CREATE EXTENSION "uuid-ossp"'
create_table :products do
column :id, :uuid, :default => Sequel.function(:uuid_generate_v4), :primary_key => true
end
end
end
@FlorinAsavoaie
Copy link

Please note that CREATE EXTENSION is only available to superuser in postgres. I do not think it is a good practice to run app migrations using superuser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment