rails g model Movie title_attribute:string category_attribute:string
Movie.create(title_attribute: 'Lilo & Stitch', category_attribute:'Cartoon') Movie.create(title_attribute: 'Princess Diaries', category_attribute:'Rom-Com') Movie.create(title_attribute: 'Death Proof', category_attribute:'Thriller') Movie.create(title_attribute: 'Hocus Pocus', category_attribute:'Comedy') Movie.create(title_attribute: 'HalloweenTown', category_attribute:'Fantasy')
- rename_column in the terminal first
$rails generate migration rename_column
- VS Code:
$rename_column :movies, :category_attribute, :genre
- Back to terminal rails db:migrate
- VS Code: Check back Schema