Commit f8203de9 authored by Steve Abrams's avatar Steve Abrams Committed by Achilleas Pipinellis

Add the 'why' for alternative primary key options

parent d2ea47cd
...@@ -105,6 +105,8 @@ create_table :user_configs, id: false do |t| ...@@ -105,6 +105,8 @@ create_table :user_configs, id: false do |t|
end end
``` ```
Setting `default: nil` will ensure a primary key sequence is not created, and since the primary key
will automatically get an index, we set `index: false` to avoid creating a duplicate.
You will also need to add the new primary key to the model: You will also need to add the new primary key to the model:
```ruby ```ruby
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment