Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,9 +4,36 @@ import sqlite3
|
|
| 4 |
import os
|
| 5 |
import datetime
|
| 6 |
|
|
|
|
|
|
|
|
|
|
| 7 |
# Paths
|
| 8 |
-
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
# Initialize database
|
| 12 |
conn = sqlite3.connect(DB_FILE)
|
|
|
|
| 4 |
import os
|
| 5 |
import datetime
|
| 6 |
|
| 7 |
+
DATA_DIR = "data"
|
| 8 |
+
os.makedirs(DATA_DIR, exist_ok=True)
|
| 9 |
+
|
| 10 |
# Paths
|
| 11 |
+
DB_PATH = os.path.join(DATA_DIR, "teamup.db")
|
| 12 |
+
|
| 13 |
+
# Initialize SQLite DB
|
| 14 |
+
def init_db():
|
| 15 |
+
with sqlite3.connect(DB_PATH) as conn:
|
| 16 |
+
conn.execute("""
|
| 17 |
+
CREATE TABLE IF NOT EXISTS teamup (
|
| 18 |
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
| 19 |
+
Name TEXT,
|
| 20 |
+
Discord TEXT UNIQUE,
|
| 21 |
+
City TEXT,
|
| 22 |
+
Country TEXT,
|
| 23 |
+
Address TEXT,
|
| 24 |
+
Looking TEXT,
|
| 25 |
+
Onlinecheck TEXT,
|
| 26 |
+
Languages TEXT,
|
| 27 |
+
Laptop TEXT,
|
| 28 |
+
Robot TEXT,
|
| 29 |
+
Skills TEXT,
|
| 30 |
+
Describe3 TEXT,
|
| 31 |
+
Experience TEXT,
|
| 32 |
+
Idea TEXT
|
| 33 |
+
);
|
| 34 |
+
""")
|
| 35 |
+
print("✅ SQLite database initialized.")
|
| 36 |
+
init_db()
|
| 37 |
|
| 38 |
# Initialize database
|
| 39 |
conn = sqlite3.connect(DB_FILE)
|