Make lectures belong to courses
This commit is contained in:
@@ -1,4 +1,6 @@
|
|||||||
class Lecture < ApplicationRecord
|
class Lecture < ApplicationRecord
|
||||||
|
belongs_to :course
|
||||||
|
|
||||||
enum :status, [
|
enum :status, [
|
||||||
:future,
|
:future,
|
||||||
:live,
|
:live,
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
class AddCourseIdToLectures < ActiveRecord::Migration[7.0]
|
||||||
|
def change
|
||||||
|
add_belongs_to(:lectures, :course)
|
||||||
|
end
|
||||||
|
end
|
||||||
Generated
+3
-1
@@ -10,7 +10,7 @@
|
|||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# 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
|
# These are extensions that must be enabled in order to support this database
|
||||||
enable_extension "plpgsql"
|
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.string "recording_id", null: false
|
||||||
t.datetime "created_at", null: false
|
t.datetime "created_at", null: false
|
||||||
t.datetime "updated_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
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user