[RAILS] [Output] About the database

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

    1. "2020 ..._ create_posts.rb" is created in 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

[Output] About the database
Output about the method # 2
Output about the method Part 1
About the package
About Java log output
About the StringBuilder class
Commentary: About the interface
About the asset pipeline
About the function double-java
About the ternary operator
About the length method
About the Kernel module
About the authenticate method.
About the map method
About the ancestors method
About the [ruby] operator
About the to_s method.
Talking about the merits of database bind variables ((1) Introduction)
About the handling of Null
About specifying the JAXRS path
about the where method (rails)
A note about the scope
About the description of Docker-compose.yml
About the File :: Stat class
About the same and equivalent
About the Android life cycle
About the explanation about functional type
About the programming language Crystal
About the behavior of ruby Hash # ==
About the language to be learned
Dynamically switch the database to connect to
[Rails] About the Punk List function
About the equals () and hashcode () methods
About the symbol <%%> in Rails erb
About the information sharing app band
About the current development environment (Java 8)
Check H2 database on the web
A murmur about the utility class
About the role of the initialize method
Think about the 7 rules of Optional
About =
Summary about the introduction of Device
About the log level of java.util.logging.Logger
Talk about the merits of database bind variables (② Merit: Prevention of SQL injection)
About the trap that the database (DB) becomes unusable due to Docker update
About the version of Docker's Node.js image
Guess about the 2017 Java Persistence Framework (3) Reladomo
Check once again about the OpenSSL command
About the procedure for java to work
About the new Java release model @ Seki Java (2018/07/20)
About the operation of next () and nextLine ()
About the initial display of Spring Framework
About the error message Invalid redeclaration of'***'
Output of the book "Introduction to Java"
About the treatment of BigDecimal (with reflection)
About the difference between irb and pry
[Japanese version Faker] About the gem "gimei"
About the number of threads of Completable Future
[Java] Color the standard output to the terminal
About the mechanism of the Web and HTTP
[Rails] Reset the database in the production environment