From 753d4a28d44fb848e71b15b93c90c418c08c28b1 Mon Sep 17 00:00:00 2001 From: emanuelfeld Date: Thu, 28 Sep 2017 23:57:48 -0400 Subject: [PATCH] Check if primary column on first _sync_table call Checks if column is primary key column on table creation, before attempting to add again as non-primary key column. --- dataset/table.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dataset/table.py b/dataset/table.py index 5e2bb76..6c0cfd4 100644 --- a/dataset/table.py +++ b/dataset/table.py @@ -241,7 +241,8 @@ class Table(object): autoincrement=increment) self._table.append_column(column) for column in columns: - self._table.append_column(column) + if not column.name == self._primary_id: + self._table.append_column(column) self._table.create(self.db.executable, checkfirst=True) elif len(columns): with self.db.lock: