We’re working as a team of programmers and for most of us, when we run rake db:migrate, we get our datetime columns to show up with the datetime datatype in the schema.rb file, but for others, when they run rake db:migrate, these columns show up as timestamp in the schema.rb file.(See example below). We’re all on Ruby 2.1.0 and Rails 4.0.9 and using Postgres for our DB. I know that as far as the postgres goes, it treats both timestamp and datetime the same, but is there anyway to fix this? Is there a setting that needs to be changed?
create_table “contacts”, force: true do |t|
There’s a good explanation here: http://stackoverflow.com/questions/3928275/in-ruby-on-rails-whats-the-difference-between-datetime-timestamp-time-and-da
are you sure you guys are running the same version of Postgres?
What does your actual migration file look like?
We are all running the same version of Postgres: psql (PostgreSQL) 9.3.4 and below is how the migration file looks like:
class CreateContacts < ActiveRecord::Migration
create_table :contacts do |t|
The problem we’re seeing is that when some people run the migration they get t.datetime while some others get t.timestamp. As far as rails goes, rails doesn’t care which is which as explained in the link above, but what’s causing this difference?