VWED_server/data/models/datacachesplit.py

37 lines
1.1 KiB
Python
Raw Normal View History

2025-04-30 16:57:46 +08:00
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
用户数据缓存模型
对应vwed_datacachesplit表
"""
from sqlalchemy import Column, String, DateTime, Index, Integer
from sqlalchemy.dialects.mysql import LONGTEXT
from data.models.base import BaseModel
class VWEDDataCacheSplit(BaseModel):
"""
用户数据缓存模型
对应vwed_datacachesplit表
功能存储用户特定的缓存数据支持更高效的数据索引和检索
"""
__tablename__ = 'vwed_datacachesplit'
__table_args__ = (
Index('dataKeyIndex', 'data_key', mysql_length=768, mysql_using='btree'),
{
'mysql_engine': 'InnoDB',
'mysql_charset': 'utf8mb4',
'mysql_collate': 'utf8mb4_bin',
'mysql_row_format': 'Dynamic',
'info': {'order_by': 'updated_on DESC'}
}
)
id = Column(String(255), primary_key=True, nullable=False, comment='缓存记录ID')
data_key = Column(LONGTEXT, nullable=False, comment='数据键名')
data_value = Column(LONGTEXT, nullable=True, comment='数据值')
def __repr__(self):
return f"<VWEDDataCacheSplit(id='{self.id}')>"