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

Update migration class name with Rails version #21

Open
bronzdoc opened this issue Mar 5, 2021 · 2 comments
Open

Update migration class name with Rails version #21

bronzdoc opened this issue Mar 5, 2021 · 2 comments
Assignees

Comments

@bronzdoc
Copy link
Contributor

bronzdoc commented Mar 5, 2021

rails g model User name:string

will generate migration as shown below.

class CreateUsers < ActiveRecord::Migration
  def change
    create_table :users do |t|
      t.string :name
      t.timestamps null: false
    end
  end
end

In Rails 5 the same command will generate following migration.

class CreateUsers < ActiveRecord::Migration[5.0]
  def change
    create_table :users do |t|
      t.string :name
      t.timestamps
    end
  end
end
@arielj
Copy link

arielj commented Mar 5, 2021

hey @bronzdoc I think you mixed the title of the issue with the description of another issue here

@bronzdoc bronzdoc changed the title Migrate ActionController::Base to ApplicationController Update migration class name with Rails version Mar 5, 2021
@bronzdoc
Copy link
Contributor Author

bronzdoc commented Mar 5, 2021

@arielj fixed it 👍

@arielj arielj removed their assignment Oct 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants