Remove the unnessecary default: 'gen_random_uuid()' (#40012)

This commit is contained in:
Corey Smith 2020-08-08 04:41:34 -05:00 committed by GitHub
parent 5d3b9f7c87
commit 3c500511e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -318,9 +318,9 @@ You can use `uuid` type to define references in migrations:
```ruby
# db/migrate/20150418012400_create_blog.rb
enable_extension 'pgcrypto' unless extension_enabled?('pgcrypto')
create_table :posts, id: :uuid, default: 'gen_random_uuid()'
create_table :posts, id: :uuid
create_table :comments, id: :uuid, default: 'gen_random_uuid()' do |t|
create_table :comments, id: :uuid do |t|
# t.belongs_to :post, type: :uuid
t.references :post, type: :uuid
end
@ -414,7 +414,7 @@ extension to generate random UUIDs.
```ruby
# db/migrate/20131220144913_create_devices.rb
enable_extension 'pgcrypto' unless extension_enabled?('pgcrypto')
create_table :devices, id: :uuid, default: 'gen_random_uuid()' do |t|
create_table :devices, id: :uuid do |t|
t.string :kind
end