Suppose you are implementing a publication database and creating migrations to represent different publications. Each publication has a ‘year’ associated with it.
t.column :year, ???
Would this year be best represented as an integer, date, or datetime?
I would recommend just going with Rails conventions and doing a
Datedata type. This way, if you ever do need the month and day, you can retrieve it. Plus, it’s simple to do: