Created
February 17, 2016 18:31
-
-
Save will/dc5c29df31a929d69668 to your computer and use it in GitHub Desktop.
proper postgres types for rails
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/initializers/postgres_types.rb | |
ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::NATIVE_DATABASE_TYPES.tap do |t| | |
t[:primary_key] = "bigserial primary key" | |
t[:datetime] = "timestamptz" | |
t[:timestamp] = "timestamptz" | |
t[:string] = "text" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I was playing around with this, and I had to change it to:
in Rails 4.2 because
rake db:*
tasks were choking on it