Synchronized Editor: Store all events and allow multiple tabs

* This commit refactors the table used to store events.
* We also use a UUID as session identifier in the synchronized editor to support multiple concurrent tabs opened by the same user.
* Further, we renamed some methods to make them easier to distinguish.
This commit is contained in:
Sebastian Serth
2023-09-06 22:29:33 +02:00
committed by Sebastian Serth
parent c42fb8fc09
commit 5dd6df9418
7 changed files with 97 additions and 47 deletions

View File

@ -0,0 +1,10 @@
# frozen_string_literal: true
class RenameColumnsInEventsSynchronizedEditor < ActiveRecord::Migration[7.0]
def change
change_table :events_synchronized_editor do |t|
t.rename :action, :editor_action
t.rename :command, :action
end
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_05_190519) do
ActiveRecord::Schema[7.0].define(version: 2023_09_06_163923) do
# These are extensions that must be enabled in order to support this database
enable_extension "pg_trgm"
enable_extension "pgcrypto"
@ -154,10 +154,10 @@ ActiveRecord::Schema[7.0].define(version: 2023_09_05_190519) do
t.bigint "study_group_id", null: false
t.string "user_type", null: false
t.bigint "user_id", null: false
t.integer "command", limit: 2, default: 0, null: false, comment: "Used as enum in Rails"
t.integer "action", limit: 2, default: 0, null: false, comment: "Used as enum in Rails"
t.integer "status", limit: 2, comment: "Used as enum in Rails"
t.bigint "file_id"
t.integer "action", limit: 2, comment: "Used as enum in Rails"
t.integer "editor_action", limit: 2, comment: "Used as enum in Rails"
t.integer "range_start_row"
t.integer "range_start_column"
t.integer "range_end_row"