Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7000645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:41:55+00:00 2026-05-27T20:41:55+00:00

When I run rails g model StripeCustomer user_id:integer customer_id:integer annotate I got # ==

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T20:41:56+00:00Added an answer on May 27, 2026 at 8:41 pm

    While the mysql client’s describe command 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‘s get_schema_info method 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):

    def get_schema_info(klass, header, options = {})
      info = "# #{header}\n#\n"
      info << "# Table name: #{klass.table_name}\n#\n"
    
      max_size = klass.column_names.collect{|name| name.size}.max + 1
      klass.columns.each do |col|
        attrs = []
        attrs << "default(#{quote(col.default)})" unless col.default.nil?
        attrs << "not null" unless col.null
        attrs << "primary key" if col.name == klass.primary_key
    
        col_type = col.type.to_s
        if col_type == "decimal"
          col_type << "(#{col.precision}, #{col.scale})"
        else
          col_type << "(#{col.limit})" if col.limit
        end
    
        #...        
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a very simple Rails 3 app with a User model run by
I'd like to run the rails generate script and create a model that belongs
I have a basic Rails model with two properties, name and code . I
I have a simple model setup in my Ruby on Rails app. (User {name,
When I run: rails generate model MyUsers I get -S, [--skip-sprockets] # Skip Sprockets
Id like to create a model in rails that does not correlate to a
In Rails I have a model message: id, content I want to run a
I have created model, view and controller: $ rails generate scaffold Post name:string title:string
I am just learning Rails testing and I am not able to run ANY
I'm using webrick to run my rails app in development mode. The page includes

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.