From fd5a5693e0e04e1808c7137372559e579a5d7d03 Mon Sep 17 00:00:00 2001 From: Prince D Rusweka Rwabongoya Date: Wed, 23 Apr 2025 18:46:28 -0400 Subject: [PATCH] Update db.py --- backend/db.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/backend/db.py b/backend/db.py index 994231d..7945515 100644 --- a/backend/db.py +++ b/backend/db.py @@ -12,15 +12,14 @@ def init_db(): print("Database already initialized.") return - # Connect to SQLite database (it will create the file if it doesn't exist) conn = sqlite3.connect(db_path) create_tables(conn) - # Insert initial data (e.g., a test animal) cursor = conn.cursor() - cursor.execute('''INSERT INTO animals (name, species, breed, age, personality, image_path) - VALUES (?, ?, ?, ?, ?, ?)''', - ('TestDog', 'Dog', 'Mixed', 2, 'Friendly', '/images/test.jpg')) + cursor.execute(''' + INSERT INTO animals (name, species, breed, age, personality, image_path) + VALUES (?, ?, ?, ?, ?, ?)''', + ('TestDog', 'Dog', 'Mixed', 2, 'Friendly', '/images/test.jpg')) conn.commit() conn.close()