diff --git a/backend/init_db.py b/backend/init_db.py index 3ff33ec..7ee3ac7 100644 --- a/backend/init_db.py +++ b/backend/init_db.py @@ -1,3 +1,5 @@ +"""Script to initialize the database and populate with initial data.""" + import sqlite3 def create_database_tables(conn): @@ -34,21 +36,4 @@ def populate_initial_data(conn): animals = [ ('Luna', 'Dog', 'Labrador Mix', 2, 'Playful and energetic', '/images/luna.jpg', 'Available'), ('Oliver', 'Cat', 'Tabby', 4, 'Independent but affectionate', '/images/oliver.jpg', 'Available'), - ('Max', 'Dog', 'German Shepherd', 3, 'Loyal and intelligent', '/images/max.jpg', 'Available') - ] - - for animal in animals: - cursor.execute(''' - INSERT INTO animals (name, species, breed, age, personality, image_path, adoption_status) - VALUES (?, ?, ?, ?, ?, ?, ?) - ''', animal) - - conn.commit() - -if __name__ == "__main__": - print("Initializing pet adoption database...") - conn = sqlite3.connect('animal_shelter.db') - create_database_tables(conn) - populate_initial_data(conn) - print("Database setup complete!") - conn.close() +