Index: src/PhotoStore.cs
===================================================================
--- src/PhotoStore.cs	(revision 4648)
+++ src/PhotoStore.cs	(working copy)
@@ -575,6 +575,10 @@
 
 		if (changes.VersionsAdded != null)
 			foreach (uint version_id in changes.VersionsAdded) {
+			 	// Original version is stored in photos
+				if (version_id == Photo.OriginalVersionId)
+				 	continue;
+
 				PhotoVersion version = photo.GetVersion (version_id) as PhotoVersion;
 				Database.ExecuteNonQuery (new DbCommand (
 					"INSERT OR IGNORE INTO photo_versions (photo_id, version_id, name, uri, protected, md5_sum) " +
Index: src/Updater.cs
===================================================================
--- src/Updater.cs	(revision 4648)
+++ src/Updater.cs	(working copy)
@@ -489,6 +489,10 @@
 			});
 
 			// Update to version 17.0
+			AddUpdate (new Version (17,0), delegate () { // Clean out all Original versions that ended up in photo_versions
+				Execute (string.Format ("DELETE FROM photo_versions WHERE version_id = {0}", Photo.OriginalVersionId));
+			});
+			// Update to version 17.0
 			//AddUpdate (new Version (14,0), delegate () {
 			//	do update here
 			//});
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 4648)
+++ ChangeLog	(working copy)
@@ -1,3 +1,10 @@
+2008-12-01  Thomas Van Machelen <thomas.vanmachelen@gmail.com>:
+
+	* src/PhotoStore.cs: 	
+	* src/Updater.cs: No longer keep the original version in
+	photo_versions and clean previously created ones.  
+	Fixes bgo #559740
+
 2008-12-01  Stephane Delcroix  <sdelcroix@novell.com>
 
 	* src/f-spot.glade: dropping the old printdialog
