Simple is Best

Joined

50 Experience
0 Lessons Completed
0 Questions Solved

Activity

sorry my english.

if my user model have

t.string :name
t.string :age

and data

1 : John / 34
2 : Tom / 25

if I want to add a field and change field name

t.string :english_name       #change field name
t.string :age
t.string :location                  #add field

rake db:migrate - not work.

rake db:drop
rake db:migrate - working. but John and Tom is gone. RIP

How can i keep data while "add field" or "change fieldname" in model?

Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more.

© 2024 GoRails, LLC. All rights reserved.