I looked back on the database, so I will write it here as well.
When making a table in the terminal $ rails g model Post content :text Post is the model name content is the column name text is the data type text means a long string, that is, what goes into content is text (long character). Or "Hello"
If you run this in a terminal, you will find two files in model and migrate
When I open the file, it looks like this dif change create_table posts do |t| t.text:content
t.timestamps
The second is not created unless you do something Write rails db: migrate.
that's all
Recommended Posts