From 5492d74b61249988cb87bede8a24fa8a8c065664 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Mon, 22 Jul 2024 12:09:19 +0200 Subject: [PATCH] Schema: don't limit browser_session.user_agent to 4096 chars --- schema/mysql/schema.sql | 2 +- schema/mysql/upgrades/035.sql | 1 + schema/pgsql/schema.sql | 2 +- schema/pgsql/upgrades/035.sql | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 schema/mysql/upgrades/035.sql create mode 100644 schema/pgsql/upgrades/035.sql diff --git a/schema/mysql/schema.sql b/schema/mysql/schema.sql index 37040cf8..27f1ef5c 100644 --- a/schema/mysql/schema.sql +++ b/schema/mysql/schema.sql @@ -448,7 +448,7 @@ CREATE INDEX idx_incident_history_time_type ON incident_history(time, type) COMM CREATE TABLE browser_session ( php_session_id varchar(256) NOT NULL, username varchar(254) NOT NULL COLLATE utf8mb4_unicode_ci, - user_agent varchar(4096) NOT NULL, + user_agent text NOT NULL, authenticated_at bigint NOT NULL, CONSTRAINT pk_browser_session PRIMARY KEY (php_session_id) diff --git a/schema/mysql/upgrades/035.sql b/schema/mysql/upgrades/035.sql new file mode 100644 index 00000000..aa82a240 --- /dev/null +++ b/schema/mysql/upgrades/035.sql @@ -0,0 +1 @@ +ALTER TABLE browser_session MODIFY COLUMN user_agent text NOT NULL; diff --git a/schema/pgsql/schema.sql b/schema/pgsql/schema.sql index 8b0213ff..5ddb12e7 100644 --- a/schema/pgsql/schema.sql +++ b/schema/pgsql/schema.sql @@ -493,7 +493,7 @@ COMMENT ON INDEX idx_incident_history_time_type IS 'Incident History ordered by CREATE TABLE browser_session ( php_session_id varchar(256) NOT NULL, username citext NOT NULL, - user_agent varchar(4096) NOT NULL, + user_agent text NOT NULL, authenticated_at bigint NOT NULL, CONSTRAINT pk_browser_session PRIMARY KEY (php_session_id), diff --git a/schema/pgsql/upgrades/035.sql b/schema/pgsql/upgrades/035.sql new file mode 100644 index 00000000..844cecb8 --- /dev/null +++ b/schema/pgsql/upgrades/035.sql @@ -0,0 +1 @@ +ALTER TABLE browser_session ALTER COLUMN user_agent TYPE text;