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()