Skip to content

Commit

Permalink
Update init_db.py
Browse files Browse the repository at this point in the history
  • Loading branch information
pdr21001 authored Apr 23, 2025
1 parent 0f3388d commit d6277a1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions backend/init_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -31,6 +35,7 @@ def create_database_tables(conn):
join_date TEXT DEFAULT CURRENT_TIMESTAMP
)
''')

conn.commit()


Expand Down

0 comments on commit d6277a1

Please sign in to comment.