From af7d63b60fd1f90e4367395bf0691947e5cef35a Mon Sep 17 00:00:00 2001 From: davelopez <46503462+davelopez@users.noreply.github.com> Date: Sun, 8 Oct 2023 12:07:05 +0200 Subject: [PATCH 1/3] Increase length of CustosAuthnzToken.external_user_id --- lib/galaxy/model/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/galaxy/model/__init__.py b/lib/galaxy/model/__init__.py index 02d1ec958a4f..6652ff72814d 100644 --- a/lib/galaxy/model/__init__.py +++ b/lib/galaxy/model/__init__.py @@ -9534,7 +9534,7 @@ class CustosAuthnzToken(Base, RepresentById): id = Column(Integer, primary_key=True) user_id = Column(Integer, ForeignKey("galaxy_user.id")) - external_user_id = Column(String(64)) + external_user_id = Column(String(255)) provider = Column(String(255)) access_token = Column(Text) id_token = Column(Text) From 239fd3987951c2f2ffee87abde15398321766a85 Mon Sep 17 00:00:00 2001 From: davelopez <46503462+davelopez@users.noreply.github.com> Date: Sun, 8 Oct 2023 12:43:22 +0200 Subject: [PATCH 2/3] Add DB migration to increase external_user_id length --- ...c5d0b47a9_alter_column_external_user_id.py | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 lib/galaxy/model/migrations/alembic/versions_gxy/e93c5d0b47a9_alter_column_external_user_id.py diff --git a/lib/galaxy/model/migrations/alembic/versions_gxy/e93c5d0b47a9_alter_column_external_user_id.py b/lib/galaxy/model/migrations/alembic/versions_gxy/e93c5d0b47a9_alter_column_external_user_id.py new file mode 100644 index 000000000000..ccd1bc33cbd5 --- /dev/null +++ b/lib/galaxy/model/migrations/alembic/versions_gxy/e93c5d0b47a9_alter_column_external_user_id.py @@ -0,0 +1,30 @@ +"""alter column CustosAuthnzToken.external_user_id to increase length + +Revision ID: e93c5d0b47a9 +Revises: e0561d5fc8c7 +Create Date: 2023-10-08 12:11:02.024669 + +""" +import sqlalchemy as sa + +from galaxy.model.migrations.util import alter_column + +# revision identifiers, used by Alembic. +revision = "e93c5d0b47a9" +down_revision = "e0561d5fc8c7" +branch_labels = None +depends_on = None + +table_name = "custos_authnz_token" +column_name = "external_user_id" + +LONGER_LENGTH = 255 + + +def upgrade(): + alter_column(table_name, column_name, type_=sa.String(LONGER_LENGTH)) + + +def downgrade(): + # No need to downgrade, this is a one-way migration. Otherwise, existing data would be truncated or lost. + pass From 97356338b87fea7d3433488aa4fc2cf994deeaa6 Mon Sep 17 00:00:00 2001 From: davelopez <46503462+davelopez@users.noreply.github.com> Date: Sun, 8 Oct 2023 12:54:07 +0200 Subject: [PATCH 3/3] Update db revision tags for 23.1 --- lib/galaxy/model/migrations/dbscript.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/galaxy/model/migrations/dbscript.py b/lib/galaxy/model/migrations/dbscript.py index b55dd79c4349..721907b852ed 100644 --- a/lib/galaxy/model/migrations/dbscript.py +++ b/lib/galaxy/model/migrations/dbscript.py @@ -36,8 +36,8 @@ "22.05": "186d4835587b", "release_23.0": "caa7742f7bca", "23.0": "caa7742f7bca", - "release_23.1": "e0561d5fc8c7", - "23.1": "e0561d5fc8c7", + "release_23.1": "e93c5d0b47a9", + "23.1": "e93c5d0b47a9", }