Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove :timestamp column type #15184

Merged
merged 1 commit into from May 19, 2014
Merged

Conversation

@sgrif
Copy link
Contributor

sgrif commented May 19, 2014

The :timestamp type for columns is unused. All database adapters treat
them as the same database type. All code in ActiveRecord which changes
its behavior based on the column's type acts the same in both cases.
However, when the type is passed to code that checks for the :datetime
type, but not :timestamp (such as XML serialization), the result is
unexpected behavior.

Existing schema definitions will continue to work, and the timestamp
type is transparently aliased to datetime.

The `:timestamp` type for columns is unused. All database adapters treat
them as the same database type. All code in `ActiveRecord` which changes
its behavior based on the column's type acts the same in both cases.
However, when the type is passed to code that checks for the `:datetime`
type, but not `:timestamp` (such as XML serialization), the result is
unexpected behavior.

Existing schema definitions will continue to work, and the `timestamp`
type is transparently aliased to `datetime`.
rafaelfranca added a commit that referenced this pull request May 19, 2014
Remove :timestamp column type
@rafaelfranca rafaelfranca merged commit 03035d6 into rails:master May 19, 2014
1 check passed
1 check passed
continuous-integration/travis-ci The Travis CI build passed
Details
@sgrif sgrif deleted the sgrif:sg-remove-timestamp-type branch May 19, 2014
@yahonda
Copy link
Contributor

yahonda commented May 20, 2014

Oracle enhanced adapter handles timestamp as timestamp. https://github.com/rsim/oracle-enhanced/blob/master/lib/active_record/connection_adapters/oracle_enhanced_adapter.rb#L452-L455

Since we are behind to support rails master branch, it needs to implement 4bd5dff first and let me check...

@sgrif
Copy link
Contributor Author

sgrif commented May 20, 2014

You should be able to override the aliased_types method in the oracle adapter, and just return an empty hash. https://github.com/rails/rails/pull/15184/files#diff-21d4fbe002689dc4b0ab29f021585457R297

@yahonda
Copy link
Contributor

yahonda commented May 20, 2014

Thanks for the advice. Let me try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.