refac
This commit is contained in:
1 parent
34146ab60f
commit
38a382ef88
2 files changed
+23
-1
No files matched your search
@@ -0,0 +1,22 @@
|
|||||||
|
"""Add memory user_id index
|
||||||
|
|
||||||
|
Revision ID: a0b1c2d3e4f5
|
||||||
|
Revises: 4de81c2a3af1
|
||||||
|
Create Date: 2025-09-15 03:00:00.000000
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
from alembic import op
|
||||||
|
|
||||||
|
revision = 'a0b1c2d3e4f5'
|
||||||
|
down_revision = '4de81c2a3af1'
|
||||||
|
branch_labels = None
|
||||||
|
depends_on = None
|
||||||
|
|
||||||
|
|
||||||
|
def upgrade():
|
||||||
|
op.create_index('ix_memory_user_id', 'memory', ['user_id'])
|
||||||
|
|
||||||
|
|
||||||
|
def downgrade():
|
||||||
|
op.drop_index('ix_memory_user_id', table_name='memory')
|
||||||
@@ -19,7 +19,7 @@ class Memory(Base):
|
|||||||
__tablename__ = 'memory'
|
__tablename__ = 'memory'
|
||||||
|
|
||||||
id = Column(String, primary_key=True, unique=True)
|
id = Column(String, primary_key=True, unique=True)
|
||||||
user_id = Column(String)
|
user_id = Column(String, index=True)
|
||||||
content = Column(Text)
|
content = Column(Text)
|
||||||
updated_at = Column(BigInteger)
|
updated_at = Column(BigInteger)
|
||||||
created_at = Column(BigInteger)
|
created_at = Column(BigInteger)
|
||||||
|
|||||||
Reference in new issue
Block a user