From ab42a9cbb92a99349208fc5053d65cb175397301 Mon Sep 17 00:00:00 2001
From: Tony Mack <tmack@cs.princeton.edu>
Date: Wed, 31 Jan 2007 17:00:09 +0000
Subject: [PATCH] - modified fix_row(): skip records in person_keys table
 marked as deleted

---
 tools/upgrade-db.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/upgrade-db.py b/tools/upgrade-db.py
index 7f6dade6..70774dc1 100755
--- a/tools/upgrade-db.py
+++ b/tools/upgrade-db.py
@@ -145,6 +145,10 @@ def fix_row(row, table_name, table_fields):
 		elif row[bwlimit_index].find('kbit') > -1:
 			row[bwlimit_index] = int(row[bwlimit_index].split('kbit')[0]) \
 					     * 1000
+	elif table_name in ['person_keys']:
+		deleted_index = table_fields.index('deleted')
+		if row[deleted_index] == True:
+			return None
 	elif table_name in ['slice_attribute']:
 		# modify some invalid foreign keys
 		attribute_type_index = table_fields.index('attribute_type_id')
-- 
2.47.0