1

When i am doing

heroku db:push

to import the development database of my Rails application, the "time" columns become "text" columns. That is, they are "time" in my SQLite development database, and they were "time" on Heroku before my "push", but after that they became "text".

Is there a way to push my SQLite columns as "time"? Why is this happening?

Alexey
  • 3,843
  • 6
  • 30
  • 44
  • It is happening because Heroku uses postgres and not SQLite, check http://www.postgresql.org/docs/8.2/static/datatype-datetime.html – Kyle C Aug 17 '12 at 23:35
  • 2
    This is one of those cases where using the same DB in development by installing a local Pg will probably save you headaches. – Craig Ringer Aug 18 '12 at 01:56
  • I think you should always develop against the same type of database, personally. They vary enough for it to be a problem. – d11wtq Aug 18 '12 at 03:53
  • It is a small app for internal use, i planned to deploy it with SQLite, i just tried Heroku for convenience of its free plan, so in this case "production" is in fact "testing". I just wonder why this happens. Must be a problem or workaround in `taps`, i think. – Alexey Aug 18 '12 at 07:11
  • It seems likely that it is a taps bug. I don't know where else the problem would be. You would certainly *expect* `time` to map to `time` in most conversions. – kgrittn Aug 18 '12 at 12:21

1 Answers1

2

Heroku released an app to make it very easy to use Postgresql on your Mac, I would recommend using that in development.

http://postgresapp.com/

If you deploy to a different database than you are using locally, you are bound to get issues.

Joel Friedlaender
  • 2,191
  • 1
  • 18
  • 24
  • Thanks for the link, looks useful, i'll try to install that. I have already Postgresql on my macbook, it was not obvious to install and i do not know what made it work eventually. For my app i prefer to use SQLite. I was just wondering if i was missing some options, or if it was a bug. I reported this behavior to "taps" project just in case. – Alexey Aug 18 '12 at 10:27
  • If the app doesn't work, I guess homebrew would be best, although you say you already have it so it shouldn't be needed. If you do want to use Heroku, I would get in the habit of making postgresql your development database. – Joel Friedlaender Aug 19 '12 at 03:05