Skip to content

Instantly share code, notes, and snippets.

@buncis
Created April 20, 2019 16:57
Show Gist options
  • Save buncis/b598f8b589a45eb51bae7e754fb82aa5 to your computer and use it in GitHub Desktop.
Save buncis/b598f8b589a45eb51bae7e754fb82aa5 to your computer and use it in GitHub Desktop.
enable uuid on rails & postgresql
rails generate migration enable_pgcrypto_extension
class EnablePgcryptoExtension < ActiveRecord::Migration[5.1]
  def change
    enable_extension 'pgcrypto'
  end
end
config.generators do |g|
  g.orm :active_record, primary_key_type: :uuid
end

https://lab.io/articles/2017/04/13/uuids-rails-5-1/

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