Skip to content

Latest commit

 

History

History
41 lines (31 loc) · 1.66 KB

migrations-mh-hh.md

File metadata and controls

41 lines (31 loc) · 1.66 KB

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')

  1. rename_column in the terminal first $rails generate migration rename_column
  2. VS Code: $rename_column :movies, :category_attribute, :genre
  3. Back to terminal rails db:migrate
  4. VS Code: Check back Schema