From d6277a1a1c724159d53ada37c72849aad4bcad9a Mon Sep 17 00:00:00 2001 From: Prince D Rusweka Rwabongoya Date: Wed, 23 Apr 2025 18:25:50 -0400 Subject: [PATCH] Update init_db.py --- backend/init_db.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/backend/init_db.py b/backend/init_db.py index c70bbde..98195e5 100644 --- a/backend/init_db.py +++ b/backend/init_db.py @@ -10,6 +10,8 @@ def create_database_tables(conn): """Create tables for the database if they do not exist.""" cursor = conn.cursor() + + # Animals table creation cursor.execute(''' CREATE TABLE IF NOT EXISTS animals ( id INTEGER PRIMARY KEY AUTOINCREMENT, @@ -22,6 +24,8 @@ def create_database_tables(conn): adoption_status TEXT DEFAULT 'Available' ) ''') + + # Adopters table creation cursor.execute(''' CREATE TABLE IF NOT EXISTS adopters ( id INTEGER PRIMARY KEY AUTOINCREMENT, @@ -31,6 +35,7 @@ def create_database_tables(conn): join_date TEXT DEFAULT CURRENT_TIMESTAMP ) ''') + conn.commit()