-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: avoid "Expected
enum
but got int
" serializer warnings for ch…
…ats API (#602) close #560 Currently, the warning has only been observed in the Chat-related APIs, and it may not be fully resolved. Test API: GET /api/v1/chats. --------- Co-authored-by: Mini256 <[email protected]>
- Loading branch information
Showing
3 changed files
with
81 additions
and
5 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
backend/app/alembic/versions/2adc0b597dcd_int_enum_type.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
"""int_enum_type | ||
Revision ID: 2adc0b597dcd | ||
Revises: a54f966436ce | ||
Create Date: 2025-01-24 17:58:08.339090 | ||
""" | ||
|
||
from alembic import op | ||
from sqlalchemy.dialects import mysql | ||
|
||
from app.models.base import IntEnumType | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "2adc0b597dcd" | ||
down_revision = "a54f966436ce" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.alter_column( | ||
"chats", | ||
"visibility", | ||
existing_type=mysql.SMALLINT(), | ||
type_=IntEnumType(), | ||
existing_nullable=False, | ||
) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.alter_column( | ||
"chats", | ||
"visibility", | ||
existing_type=IntEnumType(), | ||
type_=mysql.SMALLINT(), | ||
existing_nullable=False, | ||
) | ||
# ### end Alembic commands ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters