List out what can Rails Migration do?
List out what can Rails Migration do?
Rails migrations allow you to evolve your database schema over time using Ruby code instead of writing raw SQL. Here are some key things that Rails migrations can do:
create_table :products do |t|
t.string :name
t.string :part_number
t.timestamps
end
add_column :products, :description, :text
remove_column :products, :part_number
add_reference :products, :user, foreign_key: true
create_join_table :customers, :products
Run arbitrary SQL statements[1]
Undo migrations if needed[1]
Provide a consi...
junior
Gợi ý câu hỏi phỏng vấn
Chưa có bình luận nào