When I run
rails g model StripeCustomer user_id:integer customer_id:integer
annotate
I got
# == Schema Information
# Table name: stripe_customers
# id :integer(4) not null, primary key
# user_id :integer(4)
# customer_id :integer(4)
# created_at :datetime
# updated_at :datetime
Does it mean I can only hold up to 9,999 records only? (I am quite surprise how small a default size for keys is). How do I change default IDs to be 7 digits in existing tables?
Thank you.
While the mysql client’s
describecommand really uses the display width (see the docs), the schema information in the OP’s question is very probably generated by the annontate_models gem‘sget_schema_infomethod that uses the limit attribute of each column. And the limit attribute is the number of bytes for :binary and :integer columns (see the docs).The method reads (see how the last line adds the limit):