user_id in orders table is a string?
alanjcfs opened this issue · 1 comments
I used rails_admin to create an admin interface and I got the ActiveRecord::StatementInvalid error. It turned out that user_id in orders table is a string, not an integer. https://github.com/lockitron/selfstarter/blob/master/db/migrate/20121004072706_create_orders.rb
Is there a reason for that?
I apologize for the confusion.
It's a convention that we've been using for awhile, and it appears as though I partly implemented it here.
In this case, it's unneccessary and confusing. However, if I revert to integer primary keys, it will be a nusiance to people updating (via git pull
), because SQLite doesn't let you change the column's type without resetting the database.
Instead, I'm just going to have it generate UUIDs on create, like with the Order
model.
See the following commits: