--- ../../f-spot/ChangeLog	2006-05-25 07:51:33.000000000 +0800
+++ ChangeLog	2006-05-26 09:40:18.000000000 +0800
@@ -1,3 +1,15 @@
+2006-05-26  Bengt Thuree <bengt@thuree.com> 
+
+	* PhotoStore.cs: Added extra column for Import_id
+	
+	* ImportCommand.cs:
+	* FileImportCommand.cs: 
+	* CameraFileSelectionDialog.cs: 
+	* MainWindow.cs:
+	* MainWindow.cs: Added code to track Import Sessions
+	
+	* ImportStore.cs: Partly rewrote to handle import id/time
+
 2006-05-04  Arangel Angov <arangel@linux.net.mk>
 
 	* configure.in: Added 'mk.po' to ALL_LINGUAS
--- ../../f-spot/src/CameraFileSelectionDialog.cs	2005-08-15 17:41:07.000000000 +0800
+++ src/CameraFileSelectionDialog.cs	2006-05-21 16:41:36.000000000 +0800
@@ -265,7 +265,7 @@ namespace FSpot {
 			
 			if (saved_files != null && import_files_checkbox.Active) {
 				ImportCommand command = new ImportCommand (null);
-				command.ImportFromPaths (db.Photos, saved_files, selected_tags);
+				command.ImportFromPaths (db.Photos, db.Imports, saved_files, selected_tags);
 			}
 		}
 		
--- ../../f-spot/src/FileImportBackend.cs	2006-05-15 07:01:15.000000000 +0800
+++ src/FileImportBackend.cs	2006-05-22 21:11:03.000000000 +0800
@@ -12,6 +12,7 @@ public class ImportException : System.Ex
 
 public class FileImportBackend : ImportBackend {
 	PhotoStore store;
+	ImportStore imports;
 	bool recurse;
 	bool copy;
 	string [] base_paths;
@@ -174,13 +175,14 @@ public class FileImportBackend : ImportB
 		string path = (string) file_paths [this.count];
 		
 		try {
+                        		
 			if (copy) {
 				string dest = ChooseLocation (path, directories);
 				System.IO.File.Copy (path, dest);
-				photo = store.Create (dest, path, out thumbnail);
+				photo = store.Create (dest, path, imports.GetImportId(), out thumbnail);
 				path = dest;
 			} else {
-                photo = store.Create (path, out thumbnail);
+                		photo = store.Create (path, imports.GetImportId(), out thumbnail);
 			}
 			
 			if (tags != null) {
@@ -190,6 +192,8 @@ public class FileImportBackend : ImportB
 				store.Commit(photo);
 			}
 			imported_photos.Add (photo);
+                        imports.AddPhotoToSession (photo.Id);
+                        
 			
 		} catch (System.Exception e) {
 			System.Console.WriteLine ("Error importing {0}\n{1}", path, e.ToString ());
@@ -232,6 +236,9 @@ public class FileImportBackend : ImportB
 					info.Delete ();
 			}
 		}
+		
+		// Remove the imported session
+		imports.DeleteCurrent(); 
 	}
 
 	public override void Finish ()
@@ -247,13 +254,16 @@ public class FileImportBackend : ImportB
 
 		imported_photos = null;
 		count = 0;
+		
+		imports.EndImport();    // Clean up the imported session.
 	}
 
-	public FileImportBackend (PhotoStore store, string [] base_paths, bool recurse) : this (store, base_paths, false, recurse, null) {}
+	public FileImportBackend (PhotoStore store, ImportStore imports, string [] base_paths, bool recurse) : this (store, imports, base_paths, false, recurse, null) {}
 
-	public FileImportBackend (PhotoStore store, string [] base_paths, bool copy, bool recurse, Tag [] tags)
+	public FileImportBackend (PhotoStore store, ImportStore imports, string [] base_paths, bool copy, bool recurse, Tag [] tags)
 	{
 		this.store = store;
+		this.imports = imports;
 		this.copy = copy;
 		this.base_paths = base_paths;
 		this.recurse = recurse;
@@ -274,7 +284,7 @@ public class FileImportBackend : ImportB
 
 		Db db = new Db (path, true);
 
-		FileImportBackend import = new FileImportBackend (db.Photos, args [0],true);
+		FileImportBackend import = new FileImportBackend (db.Photos, db.Imports, args [0],true);
 
 		Console.WriteLine ("Preparing...");
 
--- ../../f-spot/src/ImportCommand.cs	2006-05-24 14:21:24.000000000 +0800
+++ src/ImportCommand.cs	2006-05-26 00:56:59.000000000 +0800
@@ -313,6 +313,7 @@ public class ImportCommand : FSpot.Glade
 
 	int total;
 	PhotoStore store;
+	ImportStore import_sessions;
 	FSpot.Delay step;
 	
 	FSpot.PhotoImageView photo_view;
@@ -330,7 +331,7 @@ public class ImportCommand : FSpot.Glade
 	
 	private SourceItem Source {
 		set {
-			if (store == null || collection == null)
+			if (store == null || collection == null || import_sessions == null)
 				return;
 			
 			SourceItem item = value;
@@ -554,9 +555,10 @@ public class ImportCommand : FSpot.Glade
 		idle_start.Start ();
 	}
 
-	public int ImportFromFile (PhotoStore store, string path)
+	public int ImportFromFile (PhotoStore store, ImportStore import_sessions, string path)
 	{
 		this.store = store;
+		this.import_sessions = import_sessions;
 		this.CreateDialog ("import_dialog");
 		
 		this.Dialog.TransientFor = main_window;
@@ -646,20 +648,24 @@ public class ImportCommand : FSpot.Glade
 		}
 
 		if (response == ResponseType.Ok) {
-			this.Finish ();
-
-			if (attach_check.Active && tag_selected != null) {
-				for (int i = 0; i < collection.Count; i++) {
-					Photo p = collection [i] as Photo;
-					
-					if (p == null)
-						continue;
+			this.Finish ();                  
+                        
+		        // Loop through each imported photo and attach tag(s)
+			for (int i = 0; i < collection.Count; i++) {
+				Photo p = collection [i] as Photo;
+				
+				// if the photo pointer is null, we skip this one, and go to next photo.
+				if (p == null)
+					continue;
 					
-					p.AddTag (tag_selected);
-					store.Commit (p);
-				}
-			}
-
+				// Attach user specified tag, if required.
+				if (attach_check.Active && tag_selected != null) {
+				        p.AddTag (tag_selected);    // Save tag in database
+				        store.Commit (p);           // Save tag in photo on disk.
+                                }
+					        
+			} // for 
+			
 			this.Dialog.Destroy ();
 			return collection.Count;
 		} else {
@@ -735,29 +741,29 @@ public class ImportCommand : FSpot.Glade
 		if (collection == null)
 			return false;
 
-		DoImport (new FileImportBackend (store, pathimport, copy, recurse, null));
+		DoImport (new FileImportBackend (store, import_sessions, pathimport, copy, recurse, null));
 		return false;
 	}
 
-	public int ImportFromPaths (PhotoStore store, string [] paths)
+	public int ImportFromPaths (PhotoStore store, ImportStore import_sessions, string [] paths)
 	{
-		return ImportFromPaths (store, paths, null);
+		return ImportFromPaths (store, import_sessions, paths, null);
 	}
 
-	public int ImportFromPaths (PhotoStore store, string [] paths, bool copy)
+	public int ImportFromPaths (PhotoStore store,  ImportStore import_sessions, string [] paths, bool copy)
 	{
-		return ImportFromPaths (store, paths, null, copy);
+		return ImportFromPaths (store, import_sessions, paths, null, copy);
 	}
 	
-	public int ImportFromPaths (PhotoStore store, string [] paths, Tag [] tags)
+	public int ImportFromPaths (PhotoStore store, ImportStore import_sessions, string [] paths, Tag [] tags)
 	{
-		return ImportFromPaths (store, paths, tags, false);
+		return ImportFromPaths (store, import_sessions, paths, tags, false);
 	}
 	
-	public int ImportFromPaths (PhotoStore store, string [] paths, Tag [] tags, bool copy)
+	public int ImportFromPaths (PhotoStore store, ImportStore import_sessions, string [] paths, Tag [] tags, bool copy)
 	{
 		collection = new FSpot.PhotoList (new Photo [0]);
-		int count = DoImport (new FileImportBackend (store, paths, copy, true, tags));
+		int count = DoImport (new FileImportBackend (store, import_sessions, paths, copy, true, tags));
 
 		Finish ();
 
@@ -775,7 +781,7 @@ public class ImportCommand : FSpot.Glade
 
 		ImportCommand command = new ImportCommand ();
 
-		command.ImportFromPath (db.Photos, directory_path, true);
+		command.ImportFromPath (db.Photos, db.Imports, directory_path, true);
 
 		Application.Quit ();
 		return false;
--- ../../f-spot/src/ImportStore.cs	2006-01-23 06:43:53.000000000 +0800
+++ src/ImportStore.cs	2006-05-23 12:58:09.000000000 +0800
@@ -3,25 +3,29 @@ using System.Collections;
 using System.IO;
 using System;
 
-
-public class ImportStore : DbStore {
-
-	public class Import : DbItem {
-		// The time is always in UTC.
-		private DateTime time;
-		public DateTime Time {
-			get {
-				return time;
-			}
+public class Import : DbItem {
+	// The time is always in UTC.
+	private DateTime time;
+	public DateTime Time {
+		get {
+			return time;
 		}
+	}
 
 		public Import (uint id, long unix_time)
-			: base (id)
-		{
-			time = DbUtils.DateTimeFromUnixTime (unix_time);
-		}
+		: base (id)
+	{
+		time = DbUtils.DateTimeFromUnixTime (unix_time);
 	}
+}
 
+
+
+public class ImportStore : DbStore {
+        
+	Import import_session;                         // This import session.
+	private const int MaxNumberImports = 5;
+	        
 	private class ImportComparerByDate : IComparer {
 		public int Compare (Object a, Object b) {
 			return DateTime.Compare ((a as Import).Time, (b as Import).Time);
@@ -33,6 +37,9 @@ public class ImportStore : DbStore {
 	public ImportStore (SqliteConnection connection, bool is_new)
 		: base (connection, false)
 	{
+
+                this.import_session = null;
+
 		if (! is_new)
 			return;
 		
@@ -42,13 +49,37 @@ public class ImportStore : DbStore {
 		command.CommandText =
 			"CREATE TABLE imports (                            " +
 			"	id          INTEGER PRIMARY KEY NOT NULL,  " +
-			"       time        INTEGER			   " +
+			"       time        INTEGER not null               " +
 			")";
 
 		command.ExecuteNonQuery ();
 		command.Dispose ();
 	}
 
+	public uint GetImportId()
+	{
+                if (import_session == null) {
+                        import_session = Create ();
+                }
+                return import_session.Id;
+	
+	}
+	
+	public DateTime GetImportTime (uint import_id)
+	{
+		// Check if a valid import id.
+                if ( import_id < 1 ) 
+                	return System.DateTime.MinValue;
+		
+		return (Get (import_id) as Import).Time;
+	}
+
+	public DateTime GetImportTime (int import_id)
+	{
+		// import_id is stored as an uint.
+		return GetImportTime ((uint) import_id);
+	}
+	
 	public Import Create (DateTime time_in_utc)
 	{
 		long unix_time = DbUtils.UnixTimeFromDateTime (time_in_utc);
@@ -56,7 +87,7 @@ public class ImportStore : DbStore {
 		SqliteCommand command = new SqliteCommand ();
 		command.Connection = Connection;
 
-		command.CommandText = String.Format ("INSERT INTO import (time) VALUES ({0})  ",
+		command.CommandText = String.Format ("INSERT INTO imports (time) VALUES ({0})  ",
 						     unix_time);
 		command.ExecuteScalar ();
 		command.Dispose ();
@@ -68,6 +99,12 @@ public class ImportStore : DbStore {
 		return import;
 	}
 
+	public Import Create ()
+	{
+		return Create (System.DateTime.Now);
+	}
+
+
 	public override DbItem Get (uint id)
 	{
 		Import import = LookupInCache (id) as Import;
@@ -104,9 +141,48 @@ public class ImportStore : DbStore {
 	}
 
 	public override void Commit (DbItem item)
-	{
+	{ 
 		// Nothing to do here, since all the properties of an import are immutable.
 	}
+	
+        private uint NumberOfRows()
+        {
+                uint rows = 0;
+                SqliteCommand command = new SqliteCommand ();
+		command.Connection = Connection;
+
+		command.CommandText = "SELECT count(*) FROM imports";
+
+                SqliteDataReader reader = command.ExecuteReader ();
+                if (reader.Read ()) {
+                        rows = Convert.ToUInt32 (reader[0]);
+                }
+                
+		command.Dispose ();
+                
+                return rows;
+        }
+	
+        
+	public void EndImport ()
+	{ 
+	       import_session = null;          // So next time we import, we create a new import session.
+	}
+	
+	public void DeleteCurrent ()
+	{ 
+                Remove (import_session);
+                EndImport();
+	}
+
+        public void AddPhotoToSession (uint imported_photo_id)
+        {
+                // Add this photo id to the import session.
+                if (import_session == null) {
+                        import_session = Create ();
+                }
+		
+        }
 
 	// FIXME: Maybe this should be an abstract method in the base class?
 	public ArrayList GetAll ()
--- ../../f-spot/src/MainWindow.cs	2006-05-24 14:59:15.000000000 +0800
+++ src/MainWindow.cs	2006-05-26 09:51:26.000000000 +0800
@@ -453,14 +453,14 @@ public class MainWindow {
 			Photo p = item as Photo;
 			if (p == null)
 				continue;
-
+			
 			if (write_metadata) {
 				try {
 					p.WriteMetadataToImage ();
 				} catch (System.Exception e) {
 					Console.WriteLine ("Error syncing metadata to file\n{0}", e);
 				}
-			}
+			}			
 		}
 		
 		if (args is TimeChangedEventArgs)
@@ -1048,7 +1048,7 @@ public class MainWindow {
 	public void ImportUriList (UriList list, bool copy) 
 	{
 		ImportCommand command = new ImportCommand (main_window);
-		if (command.ImportFromPaths (db.Photos, list.ToLocalPaths (), copy) > 0) {
+		if (command.ImportFromPaths (db.Photos, db.Imports, list.ToLocalPaths (), copy) > 0) {
 			UpdateQuery ();
 		}
 	}
@@ -1056,7 +1056,7 @@ public class MainWindow {
 	public void ImportFile (string path)
 	{
 		ImportCommand command = new ImportCommand (main_window);
-		if (command.ImportFromFile (db.Photos, path) > 0) {
+		if (command.ImportFromFile (db.Photos, db.Imports, path) > 0) {
 			UpdateQuery ();
 		}
 	}
@@ -1257,7 +1257,7 @@ public class MainWindow {
 	{
 		db.Sync = false;
 		ImportCommand command = new ImportCommand (main_window);
-		if (command.ImportFromFile (db.Photos, null) > 0) {
+		if (command.ImportFromFile (db.Photos, db.Imports, null) > 0) {
 			this.last_import_path = command.ImportPath;
 			UpdateQuery ();
 		}
@@ -1664,7 +1664,6 @@ public class MainWindow {
 			Photo p = query.Photos [num];
 
 			p.RemoveTag (tags);
-
 			query.Commit (num);
 		}
 		db.CommitTransaction ();
--- ../../f-spot/src/PhotoStore.cs	2006-03-23 11:17:30.000000000 +0800
+++ src/PhotoStore.cs	2006-05-23 12:12:35.000000000 +0800
@@ -40,6 +40,7 @@ public class PhotoVersion : FSpot.IBrows
 		get { return version_id; }
 	}
 
+
 	public PhotoVersion (Photo photo, uint version_id)
 	{
 		this.photo = photo;
@@ -192,6 +193,16 @@ public class Photo : DbItem, IComparable
 		}
 	}
 
+        private uint import_session = 0;
+	public uint ImportSession {
+		get { 
+		      return import_session; 
+		}
+		set { 
+		      import_session = value; 
+		}
+	}
+	
 	private string description;
 	public string Description {
 		get {
@@ -571,8 +582,7 @@ public class Photo : DbItem, IComparable
 	}
 
 	public Photo (uint id, long unix_time, string path)
-		: this (id, unix_time,
-
+		: this (id, unix_time, 
 			System.IO.Path.GetDirectoryName (path),
 			System.IO.Path.GetFileName (path))
 	{
@@ -663,6 +673,7 @@ public class PhotoStore : DbStore {
 			"       directory_path     STRING NOT NULL,		   " +
 			"       name               STRING NOT NULL,		   " +
 			"       description        TEXT NOT NULL,	           " +
+			"       import_session     INTEGER NOT NULL,		   " +
 			"       default_version_id INTEGER NOT NULL		   " +
 			")";
 
@@ -699,13 +710,12 @@ public class PhotoStore : DbStore {
 		command.Dispose ();
 	}
 
-
-	public Photo Create (string path, out Pixbuf thumbnail)
+	public Photo Create (string path, uint import_id, out Pixbuf thumbnail)
 	{
-		return Create (path, path, out thumbnail);
+		return Create (path, path, import_id, out thumbnail);
 	}
 
-	public Photo Create (string newPath, string origPath, out Pixbuf thumbnail)
+	public Photo Create (string newPath, string origPath, uint import_id, out Pixbuf thumbnail)
 	{
 		FSpot.ImageFile img = FSpot.ImageFile.Create (origPath);
 		long unix_time = DbUtils.UnixTimeFromDateTime (img.Date);
@@ -714,14 +724,16 @@ public class PhotoStore : DbStore {
 		command.Connection = Connection;
 
 		command.CommandText = String.Format ("INSERT INTO photos (time, " +
-						     "directory_path, name, description, default_version_id) " +
-						     "       VALUES ({0}, '{1}', '{2}', '{3}', {4})",
+						     "directory_path, name, description, import_session, default_version_id) " +
+						     "       VALUES ({0}, '{1}', '{2}', '{3}', {4}, {5})",
 						     unix_time,
 						     SqlString (System.IO.Path.GetDirectoryName (newPath)),
 						     SqlString (System.IO.Path.GetFileName (newPath)),
 						     SqlString (description),
+						     import_id,
 						     Photo.OriginalVersionId);
 
+
 		command.ExecuteScalar ();
 		command.Dispose ();
 
@@ -914,6 +926,7 @@ public class PhotoStore : DbStore {
 						     "       directory_path,                       " +
 						     "       name,                                 " +
 						     "       description,                          " +
+						     "       import_session,                       " +
 						     "       default_version_id                    " +
 						     "     FROM photos                             " +
 						     "     WHERE id = {0}                          ",
@@ -925,9 +938,10 @@ public class PhotoStore : DbStore {
 					   Convert.ToInt64 (reader [0]),
 					   reader [1].ToString (),
 					   reader [2].ToString ());
-
+			
 			photo.Description = reader[3].ToString ();
-			photo.DefaultVersionId = Convert.ToUInt32 (reader[4]);
+			photo.ImportSession = Convert.ToUInt32 (reader[4]);
+			photo.DefaultVersionId = Convert.ToUInt32 (reader[5]);
 			AddToCache (photo);
 		}
 
@@ -957,6 +971,7 @@ public class PhotoStore : DbStore {
 		command.CommandText = String.Format ("SELECT id,                                   " +
 				                     "       time,                                 " +
 						     "       description,                          " +
+						     "       import_session,                       " +
 						     "       default_version_id                    " +
 						     "  FROM photos                                " +
 						     " WHERE directory_path = \"{0}\"              " +
@@ -973,7 +988,8 @@ public class PhotoStore : DbStore {
 					   filename);
 
 			photo.Description = reader[2].ToString ();
-			photo.DefaultVersionId = Convert.ToUInt32 (reader[3]);
+			photo.ImportSession = Convert.ToUInt32 (reader[3]);
+			photo.DefaultVersionId = Convert.ToUInt32 (reader[4]);
 			AddToCache (photo);
 		}
 
@@ -1180,7 +1196,8 @@ public class PhotoStore : DbStore {
 						   reader [3].ToString ());
 				
 				photo.Description = reader[4].ToString ();
-				photo.DefaultVersionId = Convert.ToUInt32 (reader[5]);		 
+			        photo.ImportSession = Convert.ToUInt32 (reader[5]);				
+			        photo.DefaultVersionId = Convert.ToUInt32 (reader[6]);		 
 				
 				version_list.Add (photo);
 			}
@@ -1216,7 +1233,8 @@ public class PhotoStore : DbStore {
 						     "       photos.directory_path,              " +
 						     "       photos.name,                        " +
 						     "       photos.description,                 " +
-						     "       photos.default_version_id           " +
+						     "       photos.import_session,              " +
+						     "       photos.default_version_id           " +						     
 						     "     FROM photos                           " +
 						     "     WHERE directory_path = \"{0}\"", dir.FullName);
 
@@ -1262,6 +1280,7 @@ public class PhotoStore : DbStore {
 		//        photos.name,
 		//        photos.description,
 		//        photos.default_version_id
+		//        photos.import_session
 		//                  FROM photos, photo_tags
 		//                  WHERE photos.id = photo_tags.photo_id
 		// 		          AND (photo_tags.tag_id = tag1
@@ -1275,6 +1294,7 @@ public class PhotoStore : DbStore {
 				      "       photos.directory_path,              " +
 				      "       photos.name,                        " +
 				      "       photos.description,                 " +
+                                      "       photos.import_session,              " +
 				      "       photos.default_version_id           " +
 				      "     FROM photos                      ");
 		
@@ -1388,14 +1408,14 @@ public class PhotoStore : DbStore {
 
 		Pixbuf unused_thumbnail;
 
-		Photo ny_landscape = db.Photos.Create (DateTime.Now.ToUniversalTime (), "/home/ettore/Photos/ny_landscape.jpg",
+		Photo ny_landscape = db.Photos.Create (DateTime.Now.ToUniversalTime (), 1, "/home/ettore/Photos/ny_landscape.jpg",
 						       out unused_thumbnail);
 		ny_landscape.Description = "Pretty NY skyline";
 		ny_landscape.AddTag (landscapes_tag);
 		ny_landscape.AddTag (favorites_tag);
 		db.Photos.Commit (ny_landscape);
 
-		Photo me_in_sf = db.Photos.Create (DateTime.Now.ToUniversalTime (), "/home/ettore/Photos/me_in_sf.jpg",
+		Photo me_in_sf = db.Photos.Create (DateTime.Now.ToUniversalTime (), 2, "/home/ettore/Photos/me_in_sf.jpg",
 						   out unused_thumbnail);
 		me_in_sf.AddTag (landscapes_tag);
 		me_in_sf.AddTag (portraits_tag);
@@ -1408,7 +1428,7 @@ public class PhotoStore : DbStore {
 		me_in_sf.CreateVersion ("UM-ed", Photo.OriginalVersionId);
 		db.Photos.Commit (me_in_sf);
 
-		Photo macro_shot = db.Photos.Create (DateTime.Now.ToUniversalTime (), "/home/ettore/Photos/macro_shot.jpg",
+		Photo macro_shot = db.Photos.Create (DateTime.Now.ToUniversalTime (), 2, "/home/ettore/Photos/macro_shot.jpg",
 						     out unused_thumbnail);
 		db.Dispose ();
 
--- ../../f-spot/src/Updater.cs	2006-02-13 15:27:36.000000000 +0800
+++ src/Updater.cs	2006-05-23 11:21:43.000000000 +0800
@@ -62,6 +62,30 @@ namespace FSpot.Database {
 				System.Console.WriteLine ("Other tag restored.  Sorry about that!");
 			});
 			
+			AddUpdate (delegate (SqliteConnection connection) {
+				System.Console.WriteLine ("Will add a insert_id field to photos!");
+				
+				string tmp_photos = MoveTableToTemp ("photos");
+System.Console.WriteLine ("Copied data to tmp table!");								
+				ExecuteNonQuery (
+					"CREATE TABLE photos (                                     " +
+					"	id                 INTEGER PRIMARY KEY NOT NULL,   " +
+					"       time               INTEGER NOT NULL,	   	   " +
+					"       directory_path     STRING NOT NULL,		   " +
+					"       name               STRING NOT NULL,		   " +
+					"       description        TEXT NOT NULL,	           " +
+					"       import_session     INTEGER NOT NULL,		   " +
+					"       default_version_id INTEGER NOT NULL		   " +
+					")");
+System.Console.WriteLine ("Created new table!");				
+				// Copy the data back from Temp table
+				ExecuteScalar (String.Format("INSERT INTO photos SELECT id, time, directory_path, name, description, 0, default_version_id FROM {0}", tmp_photos));
+System.Console.WriteLine ("Copied data back to photos!");									
+				// Delete the tmp table
+				ExecuteNonQuery (String.Format("DROP TABLE {0}", tmp_photos));
+System.Console.WriteLine ("Dropped the temp table!");									
+				System.Console.WriteLine ("Added insert_id field to photos!");
+			});
 			// Update from version 2 to 3
 			//AddUpdate (delegate (SqliteConnection connection) {
 			//	do update here
