Spaces:
Running
on
Zero
Running
on
Zero
New DB fix
Browse files
app/db.py
CHANGED
@@ -48,7 +48,13 @@ def create_db():
|
|
48 |
cursor.execute('''
|
49 |
CREATE TABLE IF NOT EXISTS spokentext (
|
50 |
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
|
51 |
spokentext TEXT,
|
|
|
52 |
timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
53 |
);
|
|
|
|
|
|
|
|
|
54 |
''')
|
|
|
48 |
cursor.execute('''
|
49 |
CREATE TABLE IF NOT EXISTS spokentext (
|
50 |
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
51 |
+
votelog_id INTEGER UNIQUE,
|
52 |
spokentext TEXT,
|
53 |
+
lang TEXT,
|
54 |
timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
55 |
);
|
56 |
+
''')
|
57 |
+
# foreign keys
|
58 |
+
cursor.execute('''
|
59 |
+
CREATE UNIQUE INDEX IF NOT EXISTS st_to_vl ON spokentext(votelog_id);
|
60 |
''')
|