Generate Session ID on server for synchronized editor

This change allows us to use the session ID immediately for the connection_change and connection_status methods. Hence, we can identify different browser sessions of the same user.
This commit is contained in:
Sebastian Serth
2023-09-12 17:39:45 +02:00
committed by Sebastian Serth
parent 914adeed42
commit cc90861bd5
5 changed files with 22 additions and 13 deletions

View File

@ -0,0 +1,7 @@
# frozen_string_literal: true
class RequireSessionIdForEventSynchronizedEditor < ActiveRecord::Migration[7.0]
def change
change_column_null :events_synchronized_editor, :session_id, false
end
end

View File

@ -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_12_142620) do
ActiveRecord::Schema[7.0].define(version: 2023_09_12_162208) do
# These are extensions that must be enabled in order to support this database
enable_extension "pg_trgm"
enable_extension "pgcrypto"
@ -166,7 +166,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_09_12_142620) do
t.jsonb "data"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.uuid "session_id"
t.uuid "session_id", null: false
t.index ["file_id"], name: "index_events_synchronized_editor_on_file_id"
t.index ["programming_group_id"], name: "index_events_synchronized_editor_on_programming_group_id"
t.index ["study_group_id"], name: "index_events_synchronized_editor_on_study_group_id"