mustafa2ak commited on
Commit
0077912
·
verified ·
1 Parent(s): ef4be56

Update database.py

Browse files
Files changed (1) hide show
  1. database.py +4 -4
database.py CHANGED
@@ -135,12 +135,12 @@ class DogDatabase:
135
  """Add new dog to database and return dog_id"""
136
  cursor = self.conn.cursor()
137
  cursor.execute('''
138
- INSERT INTO dogs (name, first_seen, is_active)
139
- VALUES (?, datetime('now'), 1)
140
  ''', (name,))
141
  self.conn.commit()
142
- dog_id = cursor.lastrowid # Get the inserted ID
143
- return dog_id # Return it!
144
 
145
  def update_dog_sighting(self, dog_id: int):
146
  """Update last seen time and increment sighting count"""
 
135
  """Add new dog to database and return dog_id"""
136
  cursor = self.conn.cursor()
137
  cursor.execute('''
138
+ INSERT INTO dogs (name, first_seen, status)
139
+ VALUES (?, datetime('now'), 'active')
140
  ''', (name,))
141
  self.conn.commit()
142
+ return cursor.lastrowid
143
+
144
 
145
  def update_dog_sighting(self, dog_id: int):
146
  """Update last seen time and increment sighting count"""