Make lectures belong to courses
This commit is contained in:
parent
38f48d1736
commit
376e80e385
@ -1,4 +1,6 @@
|
||||
class Lecture < ApplicationRecord
|
||||
belongs_to :course
|
||||
|
||||
enum :status, [
|
||||
:future,
|
||||
:live,
|
||||
|
||||
5
db/migrate/20230929171856_add_course_id_to_lectures.rb
Normal file
5
db/migrate/20230929171856_add_course_id_to_lectures.rb
Normal file
@ -0,0 +1,5 @@
|
||||
class AddCourseIdToLectures < ActiveRecord::Migration[7.0]
|
||||
def change
|
||||
add_belongs_to(:lectures, :course)
|
||||
end
|
||||
end
|
||||
4
db/schema.rb
generated
4
db/schema.rb
generated
@ -10,7 +10,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema[7.0].define(version: 2023_09_29_171730) do
|
||||
ActiveRecord::Schema[7.0].define(version: 2023_09_29_171856) do
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
|
||||
@ -30,6 +30,8 @@ ActiveRecord::Schema[7.0].define(version: 2023_09_29_171730) do
|
||||
t.string "recording_id", null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.bigint "course_id"
|
||||
t.index ["course_id"], name: "index_lectures_on_course_id"
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Loading…
Reference in New Issue
Block a user