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

Move timestamp columns to the top #43165

Closed
wants to merge 1 commit into from

Conversation

ceritium
Copy link
Contributor

@ceritium ceritium commented Sep 4, 2021

Summary

Closes #42582

Almost every model gets new columns after creation, leaving the timestamps at
an awkward position between the initial columns and everything else.

For the command bin/rails g model Book title it will generate:

class CreateBooks < ActiveRecord::Migration[7.0]
  def change
    create_table :books do |t|
      t.timestamps

      t.string :title
    end
  end
end

Closes rails#42582

Almost every model gets new columns after creation, leaving the timestamps at
an awkward position between the initial columns and everything else.

For the command `bin/rails g model Book title` it will generate:

```ruby
class CreateBooks < ActiveRecord::Migration[7.0]
  def change
    create_table :books do |t|
      t.timestamps

      t.string :title
    end
  end
end
```
@ceritium ceritium marked this pull request as ready for review September 5, 2021 17:19
@rafaelfranca
Copy link
Member

Thank you for the pull request but I don't think we have enough reason to change this. Like you said, it is just a cosmetic change that doesn't increase usability of the framework neither make anything easier to perform with it, so I prefer to not accept.

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

Successfully merging this pull request may close these issues.

Proposal: Define timestamps as two first columns in migrations by default
2 participants