Spaces:
Running
Running
axeronis commited on
Commit ·
82abf63
1
Parent(s): 46941e7
fix: correct foreign key table names in NovaMessage and update database initialization
Browse files
backend/app/models/nova.py
CHANGED
|
@@ -20,8 +20,8 @@ class NovaMessage(SQLModel, table=True):
|
|
| 20 |
__tablename__ = "nova_messages"
|
| 21 |
|
| 22 |
id: UUID = Field(default_factory=uuid4, primary_key=True)
|
| 23 |
-
tenant_id: UUID = Field(foreign_key="
|
| 24 |
-
user_id: Optional[UUID] = Field(default=None, foreign_key="
|
| 25 |
role: NovaMessageRole
|
| 26 |
content: str
|
| 27 |
current_page: Optional[str] = Field(default=None, max_length=255)
|
|
|
|
| 20 |
__tablename__ = "nova_messages"
|
| 21 |
|
| 22 |
id: UUID = Field(default_factory=uuid4, primary_key=True)
|
| 23 |
+
tenant_id: UUID = Field(foreign_key="tenants.id", index=True)
|
| 24 |
+
user_id: Optional[UUID] = Field(default=None, foreign_key="users.id")
|
| 25 |
role: NovaMessageRole
|
| 26 |
content: str
|
| 27 |
current_page: Optional[str] = Field(default=None, max_length=255)
|