Phillip,
I see that you always use timestamp instead of datetime. Have you
noticed any problems in Rails >2. How confident are you that timestamp
and datetime can be used interchangeably?
I know that TIMESTAMP needs to have a default value, but besides that,
are there any issues?
Aryk
Phillip Koebbe wrote:
> For example, the Postgres adapter defines:
>
> class ActiveRecord::ConnectionAdapters::PostgreSQLAdapter
> # in order to add or change the datatypes, this function
> # must be overriden. Be careful, then, to not remove anything.
> # That carries with it the warning that if Rails Core changes
> # this function, this override will do away with those changes!
> def native_database_types
> {
> :primary_key => "serial primary key",
> :string => { :name => "character varying", :limit => 255 },
> :text => { :name => "text" },
> :integer => { :name => "integer" },
> :float => { :name => "float" },
> :decimal => { :name => "decimal" },
> :datetime => { :name => "timestamp" },
> :timestamp => { :name => "timestamp" },
> :time => { :name => "time" },
> :date => { :name => "date" },
> :binary => { :name => "bytea" },
> :boolean => { :name => "boolean" },
> :bigint => { :name => "int8" }
> }
> end
> end
>
> This is actually my version to add support for bigints that I needed in
> a project. Notice that when :datetime or :timestamp is used, it becomes
> a timestamp in the database. If the MySQL adapter does not define this
> method explicitly, look at the abstract adapter. Also note the comment
> that I have in my overridden method. With great power comes great
> responsibility.
>
> Peace.
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---