From 76d8c108b68a112307fc7a6e93843d0941b34179 Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Sun, 9 Aug 2009 19:26:30 +0000 Subject: [PATCH] SQL import/export complete. Byte for Byte exact, excluding differences in True-False/1-0, []/(), and unicode/string svn: r12936 --- src/plugins/export/ExportSql.py | 8 ++++---- src/plugins/import/ImportSql.py | 4 +--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/plugins/export/ExportSql.py b/src/plugins/export/ExportSql.py index b7ca4ee6f..4ab02e5c8 100644 --- a/src/plugins/export/ExportSql.py +++ b/src/plugins/export/ExportSql.py @@ -168,8 +168,8 @@ def makeDB(db): gid CHARACTER(25), title TEXT, main_location CHARACTER(25), - long FLOAT, - lat FLOAT, + long TEXT, + lat TEXT, change INTEGER, marker0 INTEGER, marker1 TEXT, @@ -752,8 +752,8 @@ def export_child_ref_list(db, from_type, from_handle, to_type, ref_list): VALUES (?, ?, ?, ?, ?, ?, ?);""", handle, ref, frel[0], frel[1], mrel[0], mrel[1], private) - export_source_ref_list(db, from_type, handle, source_list) - export_list(db, from_type, handle, "note", note_list) + export_source_ref_list(db, "child_ref", handle, source_list) + export_list(db, "child_ref", handle, "note", note_list) # And finally, make a link from parent to new object export_link(db, from_type, from_handle, "child_ref", handle) diff --git a/src/plugins/import/ImportSql.py b/src/plugins/import/ImportSql.py index 24de89223..64c6c3a33 100644 --- a/src/plugins/import/ImportSql.py +++ b/src/plugins/import/ImportSql.py @@ -740,15 +740,13 @@ class SQLReader(object): private) = place # We could look this up by "place_main", but we have the handle: - main_loc = self.get_main_location(sql, main_loc, - with_parish=True) + main_loc = self.get_main_location(sql, handle, with_parish=True) alt_location_list = self.get_location_list(sql, "place_alt", handle, with_parish=True) urls = self.get_url_list(sql, "place", handle) media_list = self.get_media_list(sql, "place", handle) source_list = self.get_source_ref_list(sql, "place", handle) note_list = self.get_note_list(sql, "place", handle) - self.db.place_map[str(handle)] = (str(handle), gid, title, long, lat, main_loc, alt_location_list, urls,