Rephrase toggl scraping in term of attendances

This commit is contained in:
2023-09-29 21:19:43 +01:00
parent be4f3f75c3
commit 2934d21f5f
8 changed files with 72 additions and 8 deletions
@@ -0,0 +1,11 @@
class CreateAttendances < ActiveRecord::Migration[7.0]
def change
create_table :attendances do |t|
t.references :lecture, null: false, foreign_key: true
t.string :associated_toggl_entry
t.integer :kind
t.timestamps
end
end
end
@@ -0,0 +1,5 @@
class RemoveTogglEntryIdFromLecture < ActiveRecord::Migration[7.0]
def change
remove_column :lectures, :associated_toggl_entry
end
end
Generated
+11 -2
View File
@@ -10,10 +10,19 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[7.0].define(version: 2023_09_29_200245) do
ActiveRecord::Schema[7.0].define(version: 2023_09_29_201903) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
create_table "attendances", force: :cascade do |t|
t.bigint "lecture_id", null: false
t.string "associated_toggl_entry"
t.integer "kind"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["lecture_id"], name: "index_attendances_on_lecture_id"
end
create_table "courses", force: :cascade do |t|
t.string "title"
t.string "unit_code"
@@ -31,9 +40,9 @@ ActiveRecord::Schema[7.0].define(version: 2023_09_29_200245) do
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.bigint "course_id"
t.string "associated_toggl_entry"
t.index ["course_id"], name: "index_lectures_on_course_id"
t.index ["recording_id"], name: "index_lectures_on_recording_id", unique: true
end
add_foreign_key "attendances", "lectures"
end