I was using this command to create a model class “Listing”. However, I was interested in knowing the relationship between the datatypes of the model and the datatypes of the underlying database. In this case, it is PostgreSQL. So when I type this command:
rails generate scaffold Listing name:string
I want to know what are the possible values I can use to describe the types. What is that dependent on? The underlying database? If so then what happens if the underlying database changes later? Also, where can I get a list of the types I can use here and their capacity with an underlying db of PostgreSQL?
That command actually creates migrations for creating tables, etc, on the DB, so that’s where you should check the types supported.
I would copy/paste here but I think there is no need to.
http://guides.rubyonrails.org/migrations.html#supported-types
UPDATE
The link to the docs does not contain the information anymore. Go to this question Rails 4: List of available datatypes for the full list