mirror of
https://github.com/open-webui/open-webui.git
synced 2026-09-15 23:32:40 +00:00
fix: align index name between model and migration, drop unused import
Use explicit Index() in __table_args__ matching the migration's 'memory_user_id_idx' name (consistent with chats.py / tags.py / chat_messages.py). Avoids autogenerate churn from SQLAlchemy's default ix_memory_user_id name. Also drops the unused sqlalchemy import from the migration.
This commit is contained in:
parent
f8b39eed19
commit
d9bcb26154
2 changed files with 6 additions and 3 deletions
|
|
@ -7,7 +7,6 @@ Create Date: 2026-04-17 00:00:00.000000
|
|||
"""
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
revision = 'a749ab2aa953'
|
||||
down_revision = 'c1d2e3f4a5b6'
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ from sqlalchemy import select, delete
|
|||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
from open_webui.internal.db import Base, get_async_db_context
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
from sqlalchemy import BigInteger, Column, String, Text
|
||||
from sqlalchemy import BigInteger, Column, Index, String, Text
|
||||
|
||||
####################
|
||||
# Memory DB Schema
|
||||
|
|
@ -19,11 +19,15 @@ class Memory(Base):
|
|||
__tablename__ = 'memory'
|
||||
|
||||
id = Column(String, primary_key=True, unique=True)
|
||||
user_id = Column(String, index=True)
|
||||
user_id = Column(String)
|
||||
content = Column(Text)
|
||||
updated_at = Column(BigInteger)
|
||||
created_at = Column(BigInteger)
|
||||
|
||||
__table_args__ = (
|
||||
Index('memory_user_id_idx', 'user_id'),
|
||||
)
|
||||
|
||||
|
||||
class MemoryModel(BaseModel):
|
||||
id: str
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue