From 9b03bbd7145424ebcc8537ada25cf7ee7ac7581a Mon Sep 17 00:00:00 2001 From: Simon Quigley Date: Mon, 25 Sep 2023 13:40:49 -0500 Subject: [PATCH] Complete Lesson 6 --- app/views/movies/index.html.erb | 4 +++- db/migrate/20230925183426_add_fields_to_movies.rb | 6 ++++++ db/schema.rb | 4 +++- 3 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 db/migrate/20230925183426_add_fields_to_movies.rb diff --git a/app/views/movies/index.html.erb b/app/views/movies/index.html.erb index 106891a..bc4ea24 100644 --- a/app/views/movies/index.html.erb +++ b/app/views/movies/index.html.erb @@ -5,7 +5,9 @@ diff --git a/db/migrate/20230925183426_add_fields_to_movies.rb b/db/migrate/20230925183426_add_fields_to_movies.rb new file mode 100644 index 0000000..286affd --- /dev/null +++ b/db/migrate/20230925183426_add_fields_to_movies.rb @@ -0,0 +1,6 @@ +class AddFieldsToMovies < ActiveRecord::Migration[7.0] + def change + add_column :movies, :description, :text + add_column :movies, :released_on, :date + end +end diff --git a/db/schema.rb b/db/schema.rb index d55f641..7254875 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,13 +10,15 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.0].define(version: 2023_09_25_181424) do +ActiveRecord::Schema[7.0].define(version: 2023_09_25_183426) do create_table "movies", force: :cascade do |t| t.string "title" t.string "rating" t.decimal "total_gross" t.datetime "created_at", null: false t.datetime "updated_at", null: false + t.text "description" + t.date "released_on" end end