pvanand commited on
Commit
0ee4f3c
·
verified ·
1 Parent(s): 04cbb66

Update rag_routerv2.py

Browse files
Files changed (1) hide show
  1. 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
- 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
- )
61
- ''')
62
- db.commit()
 
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):