Fix: Add extend_existing=True to prevent MetaData conflicts on plugin reload
Co-authored-by: Fu-Jie <33599649+Fu-Jie@users.noreply.github.com>
This commit is contained in:
1
.github/copilot-instructions.md
vendored
1
.github/copilot-instructions.md
vendored
@@ -383,6 +383,7 @@ class PluginTable(owui_Base):
|
|||||||
"""Plugin storage table - inherits from OpenWebUI's Base"""
|
"""Plugin storage table - inherits from OpenWebUI's Base"""
|
||||||
|
|
||||||
__tablename__ = "plugin_table_name"
|
__tablename__ = "plugin_table_name"
|
||||||
|
__table_args__ = {"extend_existing": True} # Required to avoid conflicts on plugin reload
|
||||||
|
|
||||||
id = Column(Integer, primary_key=True, autoincrement=True)
|
id = Column(Integer, primary_key=True, autoincrement=True)
|
||||||
unique_id = Column(String(255), unique=True, nullable=False, index=True)
|
unique_id = Column(String(255), unique=True, nullable=False, index=True)
|
||||||
|
|||||||
@@ -271,6 +271,7 @@ class ChatSummary(owui_Base):
|
|||||||
"""Chat Summary Storage Table"""
|
"""Chat Summary Storage Table"""
|
||||||
|
|
||||||
__tablename__ = "chat_summary"
|
__tablename__ = "chat_summary"
|
||||||
|
__table_args__ = {"extend_existing": True}
|
||||||
|
|
||||||
id = Column(Integer, primary_key=True, autoincrement=True)
|
id = Column(Integer, primary_key=True, autoincrement=True)
|
||||||
chat_id = Column(String(255), unique=True, nullable=False, index=True)
|
chat_id = Column(String(255), unique=True, nullable=False, index=True)
|
||||||
|
|||||||
@@ -270,6 +270,7 @@ class ChatSummary(owui_Base):
|
|||||||
"""对话摘要存储表"""
|
"""对话摘要存储表"""
|
||||||
|
|
||||||
__tablename__ = "chat_summary"
|
__tablename__ = "chat_summary"
|
||||||
|
__table_args__ = {"extend_existing": True}
|
||||||
|
|
||||||
id = Column(Integer, primary_key=True, autoincrement=True)
|
id = Column(Integer, primary_key=True, autoincrement=True)
|
||||||
chat_id = Column(String(255), unique=True, nullable=False, index=True)
|
chat_id = Column(String(255), unique=True, nullable=False, index=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user