What are the functions performed by rails migration?



What are the functions performed by rails migration?..

Answer / Amrendra Bahadur Singh

Rails migrations are a powerful feature that allows developers to manage the database schema evolution for their Rails applications. They can be used to create, modify, and destroy database tables, add columns, and perform other database operations. Migrations are written in Ruby and are stored in the 'db/migrate' directory.nnEach migration represents a change in the database schema. When executed with the 'rails db:migrate' command, Rails applies all pending migrations to bring the database up-to-date.nnFor example, creating a new table called 'users' with an 'email' column could be achieved by writing a migration like this:n```rubynclass CreateUsers < ActiveRecord::Migration[5.2]n def change
create_table :users do |t|
t.string :email
end
end
end```

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Ruby on Rails Interview Questions

Can you explain me how rails implements ajax?

1 Answers  


what are the limits of Ruby on Rails?

1 Answers  


How is calling super() different from the super call?

1 Answers  


Tell us what is the difference between redirect and render in ruby on rails?

1 Answers  


What is the use of super in Ruby Rails?

1 Answers  


Explain rails caching levels.

1 Answers  


Explain some features of nested scaffolding.

1 Answers  


What is the purpose of load, auto_load, and require_relative in ruby ?

1 Answers  


What is the difference between concern and application_controller.rb in ruby on rails?

1 Answers  


how you can run Rails application without creating databases?

1 Answers  


Explain the importance of yield statement in rails.

1 Answers  


who developed rails?

1 Answers  


Categories