[chronojump/chronojump-importer] Avoids duplicates on Session names.
- From: Carles Pina i Estany <carlespina src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump/chronojump-importer] Avoids duplicates on Session names.
- Date: Tue, 27 Sep 2016 12:18:41 +0000 (UTC)
commit 2d2dc66f04c7d58bd928c39fe54e0ac5fe5a8025
Author: Carles Pina i Estany <carles pina cat>
Date: Tue Sep 27 14:17:59 2016 +0200
Avoids duplicates on Session names.
If a session name already existed: adds (1) (or (2), etc.).
src/chronojump-importer/chronojump_importer.py | 3 ++-
.../tests/user-jump-expected.sqlite | Bin 52224 -> 52224 bytes
2 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/chronojump-importer/chronojump_importer.py b/src/chronojump-importer/chronojump_importer.py
index 8412454..2a1d1ad 100755
--- a/src/chronojump-importer/chronojump_importer.py
+++ b/src/chronojump-importer/chronojump_importer.py
@@ -391,7 +391,8 @@ def import_database(source_path, destination_path, source_session):
source_file=source_path))
sys.exit(1)
- destination_db.write(table=session, matches_columns=destination_db.column_names("Session", ["uniqueID"]))
+ destination_db.write(table=session, matches_columns=destination_db.column_names("Session", ["uniqueID"]),
+ avoids_duplicate_column="name")
new_session_id = session[0].get('new_uniqueID')
diff --git a/src/chronojump-importer/tests/user-jump-expected.sqlite
b/src/chronojump-importer/tests/user-jump-expected.sqlite
index 47622a0..a28383d 100644
Binary files a/src/chronojump-importer/tests/user-jump-expected.sqlite and
b/src/chronojump-importer/tests/user-jump-expected.sqlite differ
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]