From 08a30d80f27698b666d296463fa8698dcbd918ce Mon Sep 17 00:00:00 2001 From: error god <121949222+err0rgod@users.noreply.github.com> Date: Wed, 10 Jun 2026 00:43:50 +0530 Subject: [PATCH] Change access_token and refresh_token to Text type Changed access_token and refresh_token columns to use Text type for better handling of larger strings. --- fastapi_users_db_sqlalchemy/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fastapi_users_db_sqlalchemy/__init__.py b/fastapi_users_db_sqlalchemy/__init__.py index 467a2bf..58eeeb3 100644 --- a/fastapi_users_db_sqlalchemy/__init__.py +++ b/fastapi_users_db_sqlalchemy/__init__.py @@ -5,7 +5,7 @@ from fastapi_users.db.base import BaseUserDatabase from fastapi_users.models import ID, OAP, UP -from sqlalchemy import Boolean, ForeignKey, Integer, String, func, select +from sqlalchemy import Boolean, ForeignKey, Integer, String, func, select, Text from sqlalchemy.ext.asyncio import AsyncSession from sqlalchemy.orm import Mapped, declared_attr, mapped_column from sqlalchemy.sql import Select @@ -69,10 +69,10 @@ class SQLAlchemyBaseOAuthAccountTable(Generic[ID]): oauth_name: Mapped[str] = mapped_column( String(length=100), index=True, nullable=False ) - access_token: Mapped[str] = mapped_column(String(length=1024), nullable=False) + access_token: Mapped[str] = mapped_column(Text, nullable=False) expires_at: Mapped[Optional[int]] = mapped_column(Integer, nullable=True) refresh_token: Mapped[Optional[str]] = mapped_column( - String(length=1024), nullable=True + Text, nullable=True ) account_id: Mapped[str] = mapped_column( String(length=320), index=True, nullable=False