Last active
February 9, 2017 20:04
Revisions
-
wadik revised this gist
Feb 9, 2017 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,4 +6,7 @@ create_table :users, id: :uuid do |t| t.string :name end #Use SecureRandom.uuid -
wadik created this gist
Feb 9, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ Enabling UUIDs by default in Rails apps is easy. Just edit the config file: # config/application.rb config.active_record.primary_key = :uuid You can use UUIDs for an individual table with Rails migrations: create_table :users, id: :uuid do |t| t.string :name end