db Table Column 지원 목록
기본적으로 SQL의 목록을 따른다.
:String
짧은 문자열. 제목이나 태그로 사용.
:Text:
긴 문자열. html의 text_area에 적합.
:Integer
숫자
:Decimal
정밀한 소수. 부동소수점을 정확하게 제공해준다.
:Boolean
true, false만 저장함.
:Binray
사진이나 영상을 원본 그대로 보존할때 사용.
:Date, :Time, :DateTime
날짜와 시간을 저장할때 사용.
Rails 4버전과 PostgreSQL을 사용한다면 이것도 가능
:hstore
:array
:cidr_address
:ip_address
:mac_address
참조 :
https://stackoverflow.com/questions/11889048/is-there-documentation-for-the-rails-column-types
https://stackoverflow.com/questions/3260345/list-of-rails-model-types
'Web Design > Ruby on Rails(ROR)' 카테고리의 다른 글
Rails db migration 관련 커맨드 (0) | 2017.06.15 |
---|---|
Rails REST 에 대하여 (0) | 2017.06.13 |
Rails MVC(Model-View-Controller) 이름짓기 (0) | 2017.06.12 |
Rails html <form> 자동생성 기능: form_for (0) | 2017.06.09 |