Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions fastapi_users_db_sqlalchemy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 BigInteger, Boolean, ForeignKey, String, func, select
from sqlalchemy.ext.asyncio import AsyncSession
from sqlalchemy.orm import Mapped, declared_attr, mapped_column
from sqlalchemy.sql import Select
Expand Down Expand Up @@ -70,7 +70,7 @@ class SQLAlchemyBaseOAuthAccountTable(Generic[ID]):
String(length=100), index=True, nullable=False
)
access_token: Mapped[str] = mapped_column(String(length=1024), nullable=False)
expires_at: Mapped[Optional[int]] = mapped_column(Integer, nullable=True)
expires_at: Mapped[Optional[int]] = mapped_column(BigInteger, nullable=True)
refresh_token: Mapped[Optional[str]] = mapped_column(
String(length=1024), nullable=True
)
Expand Down
6 changes: 6 additions & 0 deletions tests/test_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,3 +219,9 @@ async def test_queries_oauth(
"foo", "bar"
)
assert unknown_oauth_user is None


def test_oauth_account_expires_at_is_big_integer():
from sqlalchemy import BigInteger

assert isinstance(OAuthAccount.__table__.c.expires_at.type, BigInteger)