rails/rails — Issue #3520: Migrations do not support :precision for postgres timestamp.
Author: mattscilipoti
Created: 2011-11-04 15:12:38+00:00
State: open

Without this, it is very difficult to retrieve datetime fileds in Rails. The database holds a higher precision than the time as a string. See #3519.

Tried both create_table and change_column.

``` ruby
create_table :test do |t|
t.datetime :sent_at, :precision => 0 #ignore fractions of seconds
end
```

```
Table "public.test"
Column | Type | Modifiers
---------+-----------------------------+---------------------------------------------------
id | integer | not null default nextval('test_id_seq'::regclass)
sent_at | timestamp without time zone |
```

That *should* be `timestamp(0) without time zone`.

I am working on a patch, but I felt I should announce the issue first.

Input is encouraged.