[RAILS] Column type quick reference table

Simplified chart

Type Overview
primary_key Primary key
string Character string (1 to 255 characters)
text Long string (1 to 4294967296 characters)
integer Integer (4 bytes)
smallint The range of values is-Data type that handles integers from 32768 to 32767
bigint Integer (8 bytes)
float Floating point
decimal Highly accurate decimal
numeric Numerical value
datetime Date and time
timestamp Update time
binary Binary data
boolean Boolean value
char A fixed-length character string. 0~Up to 255
vachar A variable length character string. 0~Up to 65535

Recommended Posts

Column type quick reference table
[Rails] haml code quick reference table
systemclt & service quick reference table (CentOS7 & Amazon Linux 2)
I want to add a reference type column later
Basic data type and reference type
Rails reference type creation added
Docker Gradle Quick Reference Japanese Translation
What is a column Boolean type?
What is a reference type variable?
Difference between primitive type and reference type
[Rails] How to create a table, add a column, and change the column type