From 86deb2b4c4c16181ca7ed4ea6808fc7ec74fa856 Mon Sep 17 00:00:00 2001 From: "grafana-delivery-bot[bot]" <132647405+grafana-delivery-bot[bot]@users.noreply.github.com> Date: Thu, 24 Oct 2024 18:36:43 +0300 Subject: [PATCH] [v11.3.x] Auth: Increase name_id and session_id length to 1024 in user_external_session (#95360) Auth: Increase name_id and session_id length to 1024 in user_external_session (#95352) Increase name_id and session_id length to 1024 (cherry picked from commit b8b7c7901c0343d239cee9302a4e6283f1e2f479) Co-authored-by: Misi --- .../sqlstore/migrations/externalsession/migrations.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkg/services/sqlstore/migrations/externalsession/migrations.go b/pkg/services/sqlstore/migrations/externalsession/migrations.go index e3350334a0a..2770164cb7d 100644 --- a/pkg/services/sqlstore/migrations/externalsession/migrations.go +++ b/pkg/services/sqlstore/migrations/externalsession/migrations.go @@ -28,4 +28,12 @@ func AddMigration(mg *migrator.Migrator) { } mg.AddMigration("create user_external_session table", migrator.NewAddTableMigration(externalSessionV1)) + + mg.AddMigration("increase name_id column length to 1024", migrator.NewRawSQLMigration(""). + Mysql("ALTER TABLE user_external_session MODIFY name_id NVARCHAR(1024);"). + Postgres("ALTER TABLE user_external_session ALTER COLUMN name_id TYPE VARCHAR(1024);")) + + mg.AddMigration("increase session_id column length to 1024", migrator.NewRawSQLMigration(""). + Mysql("ALTER TABLE user_external_session MODIFY session_id NVARCHAR(1024);"). + Postgres("ALTER TABLE user_external_session ALTER COLUMN session_id TYPE VARCHAR(1024);")) }