Spaces:
Sleeping
Sleeping
Update rag_routerv2.py
Browse files- rag_routerv2.py +11 -10
rag_routerv2.py
CHANGED
@@ -50,16 +50,17 @@ def init_db():
|
|
50 |
created_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
51 |
)
|
52 |
''')
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
|
|
63 |
|
64 |
# Pydantic models
|
65 |
class CreateTableResponse(BaseModel):
|
|
|
50 |
created_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
51 |
)
|
52 |
''')
|
53 |
+
db.execute('''
|
54 |
+
CREATE TABLE IF NOT EXISTS table_files (
|
55 |
+
id INTEGER PRIMARY KEY,
|
56 |
+
table_id TEXT NOT NULL,
|
57 |
+
filename TEXT NOT NULL,
|
58 |
+
file_path TEXT NOT NULL,
|
59 |
+
FOREIGN KEY (table_id) REFERENCES tables (table_id),
|
60 |
+
UNIQUE(table_id, filename)
|
61 |
+
)
|
62 |
+
''')
|
63 |
+
db.commit()
|
64 |
|
65 |
# Pydantic models
|
66 |
class CreateTableResponse(BaseModel):
|