mirror of
https://github.com/maxdorninger/MediaManager.git
synced 2026-04-17 15:13:24 +02:00
increase max refresh token length to 4096
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
"""increase_refresh_token_length
|
||||
|
||||
Revision ID: aa4689f80796
|
||||
Revises: 21a19f0675f9
|
||||
Create Date: 2025-07-06 10:54:19.714809
|
||||
|
||||
"""
|
||||
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = "aa4689f80796"
|
||||
down_revision: Union[str, None] = "21a19f0675f9"
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
"""Upgrade schema."""
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.alter_column(
|
||||
"oauth_account",
|
||||
"refresh_token",
|
||||
existing_type=sa.VARCHAR(length=1024),
|
||||
type_=sa.String(length=4096),
|
||||
existing_nullable=True,
|
||||
)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
"""Downgrade schema."""
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.alter_column(
|
||||
"oauth_account",
|
||||
"refresh_token",
|
||||
existing_type=sa.String(length=4096),
|
||||
type_=sa.VARCHAR(length=1024),
|
||||
existing_nullable=True,
|
||||
)
|
||||
# ### end Alembic commands ###
|
||||
@@ -1,4 +1,5 @@
|
||||
from collections.abc import AsyncGenerator
|
||||
from typing import Optional
|
||||
|
||||
from fastapi import Depends
|
||||
from fastapi_users.db import (
|
||||
@@ -16,6 +17,9 @@ from media_manager.database import db_url
|
||||
|
||||
class OAuthAccount(SQLAlchemyBaseOAuthAccountTableUUID, Base):
|
||||
access_token: Mapped[str] = mapped_column(String(length=4096), nullable=False)
|
||||
refresh_token: Mapped[Optional[str]] = mapped_column(
|
||||
String(length=4096), nullable=True
|
||||
)
|
||||
pass
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user