How can I create a table where the my :id field will not auto-increment?
Example table:
cost_categories
id description
-- -----------
94 Labor
101 Framing
750 Paint
Please Note: As far as my :id column goes, everything about it will be the Rails default accept the fact that I don’t want it to auto-increment.
I’ve seen a lot of answers where they suggest not doing this, but it doesn’t make sense to have, say, a rails default :id field AND my own :cc_id field.
I’d really appreciate any assistance.
For mysql DB:
In your migration file:
YOu should add your index: