Datatypes in Postgresql and Rails
Category:
Postgresql type | name in Rails | Rails type |
---|---|---|
text | text | String |
box | box | String |
polygon | polygon | String |
circle | circle | String |
timestamp | datetime | ActiveSupport::TimeWithZone |
time | time | ActiveSupport::TimeWithZone |
date | date | Date |
json | json | String |
point | point | ActiveRecord::Point |
boolean | boolean | TrueClass/FalseClass |
path | path | String |
xml | xml | String |
jsonb | jsonb | String |
bit | bit | String |
inet | inet | IPAddr |
float | float | Float |
daterange | daterange | Date…Date |
tsrange | tsrange | Time…Time |
integer | integer | Integer |
money | money | BigDecimal |
uuid | uuid | String |
numrange | numrange | BigDecimal..BigDecimal |
decimal | decimal | BigDecimal |