Skip to content

timestamps creates created_at field. #18

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

Merged
merged 1 commit into from
Sep 12, 2020
Merged

Conversation

voxik
Copy link
Contributor

@voxik voxik commented Sep 11, 2020

The t.timestamps, available since Rails 2.3, already creates the created_at column. Therefore, since Rails 6.0+ the test suite fails with the following error:

/usr/share/gems/gems/activerecord-6.0.3.2/lib/active_record/connection_adapters/abstract/schema_definitions.rb:372:in `column': you can't define an already defined column 'created_at'. (ArgumentError)
	from /usr/share/gems/gems/activerecord-6.0.3.2/lib/active_record/connection_adapters/abstract/schema_definitions.rb:411:in `timestamps'
	from /builddir/build/BUILD/test/helper.rb:114:in `block (2 levels) in <top (required)>'

The `t.timestamps`, available since Rails 2.3, already creates the
`created_at` column. Therefore, since Rails 6.0+ the test suite fails
with the following error:

~~~
/usr/share/gems/gems/activerecord-6.0.3.2/lib/active_record/connection_adapters/abstract/schema_definitions.rb:372:in `column': you can't define an already defined column 'created_at'. (ArgumentError)
	from /usr/share/gems/gems/activerecord-6.0.3.2/lib/active_record/connection_adapters/abstract/schema_definitions.rb:411:in `timestamps'
	from /builddir/build/BUILD/test/helper.rb:114:in `block (2 levels) in <top (required)>'
~~~
@kaspth kaspth merged commit 694f407 into rails:master Sep 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants