File tree Expand file tree Collapse file tree 2 files changed +4
-9
lines changed
Expand file tree Collapse file tree 2 files changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -31,14 +31,8 @@ def load_plugin_tables():
3131 if not os .path .exists (os .path .join (plugin_dir , 'database.py' )):
3232 continue # Skip plugins without a database.py file
3333
34- plugin_module = import_module (f'plugins.{ plugin_name } .database' )
35- # plugin_metadata = plugin_module.metadata
34+ import_module (f'plugins.{ plugin_name } .database' )
3635
37- # # # Copy the tables from the main metadata to the plugin metadata object
38- # # for table_name in plugin_metadata.tables:
39- # # table = plugin_metadata.tables[table_name]
40- # # table.schema = None # Reset the schema to avoid conflicts
41- # # table.metadata = metadata
4236
4337
4438class ConversationBase (SQLModel ):
@@ -68,3 +62,5 @@ class MessageRead(MessageBase):
6862
6963class ConversationWithMessages (ConversationRead ):
7064 messages : List [MessageRead ] = []
65+
66+ load_plugin_tables ()
Original file line number Diff line number Diff line change 33from sqlmodel import SQLModel , Field , Relationship
44from models .all import Conversation
55
6- metadata = SQLModel .metadata
7-
86class SamplePluginModelBase (SQLModel ):
97 """A base model for SamplePluginModel"""
108 # __tablename__: str = 'sample_plugin_model'
119 created_at : datetime = Field (default_factory = datetime .utcnow )
1210 title : Optional [str ]
11+ conversation_id : Optional [int ] = Field (default = None , foreign_key = "conversation.id" )
1312
1413class SamplePluginModel (SamplePluginModelBase , table = True ):
1514 """A model for SamplePlugin"""
You can’t perform that action at this time.
0 commit comments